我刚开始学习Maven。我有两个java文件,它们显示在下面
我使用' mvn compile'成功编译了它。并能够看到类文件
但是,我希望' target / classes / src2 /SecProg.class'而不是' target / classes / SecProg.class'
输出
./target/classes/SecProg.class
./target/classes/src1/FirstProg.class
请让我知道我做错了什么
我的源代码树如下所示
[sathish@oc3855733574 java_tools]$ tree
.
├── pom.xml
├── pom.xml_org
├── src1
│ └── FirstProg.java
├── src2
│ └── SecProg.java
我的POM.xml如下所示
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>java_tools</groupId>
<artifactId>first_prog</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<build>
<sourceDirectory>.</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<includes>
<include>src2/*.java</include>
<include>src1/*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>