部分Java文件在Maven构建期间不生成类
我有一个项目,我使用maven编译:部分Java文件在Maven构建期间不生成类,java,maven,Java,Maven,我有一个项目,我使用maven编译:mvn clean compile。Java文件的总数约为2000个 编译结果是成功的,但部分Java文件没有生成类 我使用Maven 3.0.4。系统是Linux <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId>
mvn clean compile
。Java文件的总数约为2000个
编译结果是成功的,但部分Java文件没有生成类
我使用Maven 3.0.4。系统是Linux
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!--<version>3.0</version>-->
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbose>true</verbose>
<encoding>GBK</encoding>
<compilerArguments>
<sourcepath>${project.build.sourceDirectory}</sourcepath>
<extdirs>${project.basedir}/src/lib </extdirs>
</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>
</project>
org.apache.maven.plugins
maven编译器插件
1.5
1.5
真的
GBK
${project.build.sourceDirectory}
${project.basedir}/src/lib
有效pom:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org /2001/XMLSchema-instance"
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>
<parent>
<groupId>com.xxoo</groupId>
<artifactId>xxooroot</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.xxoo</groupId>
<artifactId>xxoodev</artifactId>
<version>1.0-SNAPSHOT</version>
<description>the root pom for all maven project</description>
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Internal Release Repository</name>
<url>http://ip/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Internal Snapshot Repository</name>
<url>http://ip/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<properties>
<aspectj.version>1.6.2</aspectj.version>
<checkstyle.url>/home/tony/.config/maven_checks.xml</checkstyle.url>
<cobertura.encoding>UTF-8</cobertura.encoding>
<compile.encoding>UTF-8</compile.encoding>
<compile.source>1.6</compile.source>
<compile.target>1.6</compile.target>
<junit.version>4.8.2</junit.version>
<pmd.sourceEncoding>UTF-8</pmd.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<resource.log4j>log4j.*</resource.log4j>
<resources.encoding>UTF-8</resources.encoding>
<slf4j.version>1.7.2</slf4j.version>
<spring.version>3.1.3.RELEASE</spring.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
omitted....
</dependencies>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<id>central</id>
<url>http://central</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<url>http://central</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>/opt/myself/xxoosource/xxoodev/src/main/java</sourceDirectory>
<scriptSourceDirectory>/opt/myself/xxoosource
/xxoodev/src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>/opt/myself/xxoosource/xxoodev/src
/test /java</testSourceDirectory>
<outputDirectory>/opt/myself/xxoosource/xxoodev/target/classes</outputDirectory>
<testOutputDirectory>/opt/myself/xxoosource/xxoodev/target
/test-classes</testOutputDirectory>
<defaultGoal>package</defaultGoal>
<resources>
<resource>
<filtering>true</filtering>
<directory>/opt/myself/xxoosource/xxoodev/src/main/resources</directory>
<excludes>
<exclude>log4j.*</exclude>
</excludes>
</resource>
<resource>
<directory>/opt/myself/xxoosource/xxoodev/src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<excludes>
<exclude>log4j.*</exclude>
</excludes>
</resource>
</resources>
<testResources>
<testResource>
<filtering>true</filtering>
<directory>/opt/myself/xxoosource/xxoodev/src/test/resources</directory>
</testResource>
<testResource>
<directory>/opt/myself/xxoosource/xxoodev/src/test/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</testResource>
</testResources>
<directory>/opt/myself/xxoosource/xxoodev/target</directory>
<finalName>xxoodev-1.0-SNAPSHOT</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.7</version>
</plugin>
omitted....
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
<formats>
<format>xml</format>
</formats>
</configuration>
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
<linkXref>false</linkXref>
<sourceEncoding>UTF-8</sourceEncoding>
<minimumTokens>100</minimumTokens>
<targetJdk>1.6</targetJdk>
<excludes>
<exclude>**/generated/*.java</exclude>
</excludes>
<excludeRoots>
<excludeRoot>target/generated-sources/stubs</excludeRoot>
</excludeRoots>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-resources</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</execution>
<execution>
<id>default-testResources</id>
<phase>process-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</execution>
</executions>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbose>true</verbose>
<encoding>GBK</encoding>
<compilerArguments>
<sourcepath>/opt/myself/xxoosource/xxoodev/src
/main/java</sourcepath>
<extdirs>/opt/myself/xxoosource/xxoodev/src/lib</extdirs>
</compilerArguments>
</configuration>
</execution>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbose>true</verbose>
<encoding>GBK</encoding>
<compilerArguments>
<sourcepath>/opt/myself/xxoosource/xxoodev/src
/main/java</sourcepath>
<extdirs>/opt/myself/xxoosource/xxoodev/src/lib</extdirs>
</compilerArguments>
</configuration>
</execution>
</executions>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbose>true</verbose>
<encoding>GBK</encoding>
<compilerArguments>
<sourcepath>/opt/myself/xxoosource/xxoodev/src/main/java</sourcepath>
<extdirs>/opt/myself/xxoosource/xxoodev/src/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifestEntries>
<Build-Date>${__now}</Build-Date>
<SCM-Revision>${__revision}</SCM-Revision>
<SCM-Url>${__fullurl}</SCM-Url>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
<configuration>
<archive>
<manifestEntries>
<Build-Date>${__now}</Build-Date>
<SCM-Revision>${__revision}</SCM-Revision>
<SCM-Url>${__fullurl}</SCM-Url>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.2</version>
</plugin>
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
<formats>
<format>xml</format>
</formats>
</configuration>
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
<linkXref>false</linkXref>
<sourceEncoding>UTF-8</sourceEncoding>
<minimumTokens>100</minimumTokens>
<targetJdk>1.6</targetJdk>
<excludes>
<exclude>**/generated/*.java</exclude>
</excludes>
<excludeRoots>
<excludeRoot>target/generated-sources/stubs</excludeRoot>
</excludeRoots>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<id>default-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>default-install</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<executions>
<execution>
<id>default-site</id>
<phase>site</phase>
<goals>
<goal>site</goal>
</goals>
<configuration>
<outputDirectory>/opt/myself/xxoosource/xxoodev
/target/site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
<execution>
<id>default-deploy</id>
<phase>site-deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<outputDirectory>/opt/myself/xxoosource/xxoodev
/target/site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
</executions>
<configuration>
<outputDirectory>/opt/myself/xxoosource/xxoodev
/target/site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<outputDirectory>/opt/myself/xxoosource/xxoodev/target/site</outputDirectory>
</reporting>
</project>
4.0.0
com.xxoo
xxooroot
1.0-快照
com.xxoo
xxoodev
1.0-快照
所有maven项目的根pom
nexus发布
内部发布存储库
http://ip/nexus/content/repositories/releases
nexus快照
内部快照存储库
http://ip/nexus/content/repositories/snapshots
1.6.2
/home/tony/.config/maven_checks.xml
UTF-8
UTF-8
1.6
1.6
4.8.2
UTF-8
UTF-8
log4j*
UTF-8
1.7.2
3.1.3.1发布
奥帕林
奥帕林
1
朱尼特
朱尼特
4.8.2
测试
log4j
log4j
1.2.17
org.springframework
弹簧芯
3.1.3.1发布
org.springframework
spring上下文
3.1.3.1发布
省略。。。。
真的
真的
总是
中心的
http://central
真的
真的
中心的
http://central
/opt/imf/xxoosource/xxoodev/src/main/java
/选择/我自己/xxoosource
/xxoodev/src/main/scripts
/opt/imf/xxoosource/xxoodev/src
/测试/java
/opt/imf/xxoosource/xxoodev/target/classes
/opt/imf/xxoosource/xxoodev/target
/测试班
包裹
真的
/opt/imf/xxoosource/xxoodev/src/main/resources
log4j*
/opt/imf/xxoosource/xxoodev/src/main/java
**/*.xml
log4j*
真的
/opt/imf/xxoosource/xxoodev/src/test/resources
/opt/imf/xxoosource/xxoodev/src/test/java
**/*.物业
**/*.xml
/opt/imf/xxoosource/xxoodev/target
xxoodev-1.0-SNAPSHOT
maven antrun插件
1.3
maven汇编插件
2.3
org.mortbay.jetty
maven jetty插件
6.1.7
省略。。。。
org.codehaus.mojo
cobertura maven插件
2.5
UTF-8
xml
maven pmd插件
2.5
假的
UTF-8
100
1.6
**/生成的/*.java
目标/生成的源/存根
maven战争插件
2.1.1
maven依赖插件
2.2
maven发布插件
2
maven资源插件
2.5
maven编译器插件
2.3.2
maven部署插件
2.6
maven安装插件
2.3.1
maven资源插件
2.5
默认资源
过程资源
资源
UTF-8
默认测试资源
过程测试资源
测试资源
UTF-8
UTF-8
maven编译器插件
2.3.2
默认测试编译
测试编译
测试编译
1.5
1.5
真的
GBK
/opt/imf/xxoosource/xxoodev/src
/main/java
/opt/imf/xxoosource/xxoodev/src/lib
默认编译