最初在titan的源码里看到这个错误的。搜了一下这个错是eclipse的插件m2e的问题。不是真正的错误。
这是验证代码。这个验证代码可以让你更加了解多模块工程时maven会智能的决定最先构建哪个模块。每个模块都有自己的构建周期,xml没有写错。
可以用一个<pluginManagement>把插件包住,这样eclipse里就不报错了。但是<pluginManagement>的使用场景是父项目里定义,然后子项目里继承使用。 这里加一个<pluginManagement>只是为了看不到这个错误感觉有点名不正言不顺。 最好的办法就是忽略,不去管他。我试过了,jdk1.7+eclipse mars版本,或者 jdk1.8+eclipse neon.1版本都是会报这个错的。maven的版本都是3.3.9。
下面验证一下这个错误不影响使用。
1.新建一个maven项目叫parentProj.
2.建子模块mod-all,mod-parent,mod-test。其中mod-all包含子模块 mod1,mod2。 mod-parent包含子模块mod-3。(titan的源码里就是个样子的)
3.在mod-parent的pom.xml里加入
<pluginManagement> <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>generate-cached-classpath</id> <phase>generate-test-resources</phase> <goals> <goal>build-classpath</goal> </goals> <configuration> <outputFile>${project.basedir}/target/cached_classpath.txt</outputFile> </configuration> </execution> <execution> <id>unpack-common-test-classes</id> <phase>process-test-classes</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>${project.groupId}</groupId> <artifactId>mod2</artifactId> <version>${project.version}</version> <classifier>tests</classifier> <outputDirectory>${project.build.directory}/test-classes</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. --> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <versionRange>[2.2.1,)</versionRange> <goals> <goal>build-classpath</goal> <goal>unpack</goal> </goals> </pluginExecutionFilter> <action> <execute /> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement>
然后在mod3里加入
<plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>generate-cached-classpath</id> </execution> <!-- 为什么此处可以解压mod2-tests.jar? 因为maven构建一开始的时候就已经reorder了。可以看到mod2是最先执行的,构建完mod2之后才开始构建mod3的 --> <execution> <id>unpack-common-test-classes</id> </execution> </executions> </plugin>
此时在<execution>处就会报
Artifact has not been packaged yet. When used on reactor artifact,unpack should be executed after packaging: see MDEP-98.
4.加入测试代码
mod1里有一个类叫ModA。里面有一个方法printA
mod2里有一个类叫ModB。里面有一个方法printB
mod-test里有一个以Test开头的类。 类里有一个方法调用ModA的printA方法
mod-all
|-- mod1
|-- ModA
|-- mod2
|-- ModB
mod-parent
|--mod3
mod-test
|-- TestModA
5.测试
cd /d D:\WorkSpace3\parentProj
mvn clean install
输出如下:
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>cd /d D:\WorkSpace3\parentProj
D:\WorkSpace3\parentProj>mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] parentProj
[INFO] mod2
[INFO] mod1
[INFO] mod-test
[INFO] mod-all
[INFO] mod-parent
[INFO] mod3
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building parentProj 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ parentProj ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ parentProj ---
[INFO] Installing D:\WorkSpace3\parentProj\pom.xml to E:\repo\com\lx\parentProj\0.0.1-SNAPSHOT\parentProj-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mod2 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod2 ---
[INFO] Deleting D:\WorkSpace3\parentProj\mod2\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod2\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod2\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod2 ---
[INFO] Surefire report directory: D:\WorkSpace3\parentProj\mod2\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running mod2.Mod2Test
mod2 测试............
Tests run: 1,Failures: 0,Errors: 0,Skipped: 0,Time elapsed: 0.056 sec - in mod2.Mod2Test
Results :
Tests run: 1,Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod2 ---
[INFO] Building jar: D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-jar-plugin:2.4:test-jar (pack-test-jar) @ mod2 ---
[INFO] Building jar: D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT-tests.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ mod2 ---
[INFO] Installing D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod2\0.0.1-SNAPSHOT\mod2-0.0.1-SNAPSHOT.jar
[INFO] Installing D:\WorkSpace3\parentProj\mod2\pom.xml to E:\repo\com\lx\mod2\0.0.1-SNAPSHOT\mod2-0.0.1-SNAPSHOT.pom
[INFO] Installing D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT-tests.jar to E:\repo\com\lx\mod2\0.0.1-SNAPSHOT\mod2-0.0.1-SNAPSHOT-tests.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mod1 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod1 ---
[INFO] Deleting D:\WorkSpace3\parentProj\mod1\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod1 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod1\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod1 ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod1 ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod1 ---
[INFO] Building jar: D:\WorkSpace3\parentProj\mod1\target\mod1-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ mod1 ---
[INFO] Installing D:\WorkSpace3\parentProj\mod1\target\mod1-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod1\0.0.1-SNAPSHOT\mod1-0.0.1-SNAPSHOT.jar
[INFO] Installing D:\WorkSpace3\parentProj\mod1\pom.xml to E:\repo\com\lx\mod1\0.0.1-SNAPSHOT\mod1-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mod-test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod-test ---
[INFO] Deleting D:\WorkSpace3\parentProj\mod-test\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod-test\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod-test ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod-test ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod-test ---
[INFO] Building jar: D:\WorkSpace3\parentProj\mod-test\target\mod-test-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ mod-test ---
[INFO] Installing D:\WorkSpace3\parentProj\mod-test\target\mod-test-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod-test\0.0.1-SNAPSHOT\mod-test-0.0.1-SNAPSHOT.jar
[INFO] Installing D:\WorkSpace3\parentProj\mod-test\pom.xml to E:\repo\com\lx\mod-test\0.0.1-SNAPSHOT\mod-test-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mod-all 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod-all ---
[INFO] Deleting D:\WorkSpace3\parentProj\mod-all\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod-all ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\WorkSpace3\parentProj\mod-all\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod-all ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod-all ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\WorkSpace3\parentProj\mod-all\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod-all ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod-all ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod-all ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: D:\WorkSpace3\parentProj\mod-all\target\mod-all-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ mod-all ---
[INFO] Installing D:\WorkSpace3\parentProj\mod-all\target\mod-all-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod-all\0.0.1-SNAPSHOT\mod-all-0.0.1-SNAPSHOT.jar
[INFO] Installing D:\WorkSpace3\parentProj\mod-all\pom.xml to E:\repo\com\lx\mod-all\0.0.1-SNAPSHOT\mod-all-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mod-parent 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod-parent ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ mod-parent ---
[INFO] Installing D:\WorkSpace3\parentProj\mod-parent\pom.xml to E:\repo\com\lx\mod-parent\0.0.1-SNAPSHOT\mod-parent-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mod3 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod3 ---
[INFO] Deleting D:\WorkSpace3\parentProj\mod-parent\mod3\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod3 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\WorkSpace3\parentProj\mod-parent\mod3\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod3 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod-parent\mod3\target\classes
[INFO]
[INFO] --- maven-dependency-plugin:2.8:build-classpath (generate-cached-classpath) @ mod3 ---
[INFO] Wrote classpath file 'D:\WorkSpace3\parentProj\mod-parent\mod3\target\cached_classpath.txt'.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod3 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\WorkSpace3\parentProj\mod-parent\mod3\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod3 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod-parent\mod3\target\test-classes
[INFO]
[INFO] --- maven-dependency-plugin:2.8:unpack (unpack-common-test-classes) @ mod3 ---
[INFO] Configured Artifact: com.lx:mod2:tests:0.0.1-SNAPSHOT:jar
[INFO] Unpacking D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT-tests.jar to D:\WorkSpace3\parentProj\mod-parent\mod3\target\test-classes with includes "" and excludes ""
[INFO]
[INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod3 ---
[INFO] Surefire report directory: D:\WorkSpace3\parentProj\mod-parent\mod3\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running mod2.Mod2Test
mod2 测试............
Tests run: 1,Time elapsed: 0.078 sec - in mod2.Mod2Test
Running org.mod3.Mod3Test
mod3 测试..................
Tests run: 1,Time elapsed: 0.003 sec - in org.mod3.Mod3Test
Results :
Tests run: 2,Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod3 ---
[INFO] Building jar: D:\WorkSpace3\parentProj\mod-parent\mod3\target\mod3-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ mod3 ---
[INFO] Installing D:\WorkSpace3\parentProj\mod-parent\mod3\target\mod3-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod3\0.0.1-SNAPSHOT\mod3-0.0.1-SNAPSHOT.jar
[INFO] Installing D:\WorkSpace3\parentProj\mod-parent\mod3\pom.xml to E:\repo\com\lx\mod3\0.0.1-SNAPSHOT\mod3-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] parentProj ......................................... SUCCESS [ 0.595 s]
[INFO] mod2 ............................................... SUCCESS [ 2.787 s]
[INFO] mod1 ............................................... SUCCESS [ 0.332 s]
[INFO] mod-test ........................................... SUCCESS [ 0.303 s]
[INFO] mod-all ............................................ SUCCESS [ 0.287 s]
[INFO] mod-parent ......................................... SUCCESS [ 0.069 s]
[INFO] mod3 ............................................... SUCCESS [ 1.840 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.730 s
[INFO] Finished at: 2016-10-27T14:32:15+08:00
[INFO] Final Memory: 21M/219M
[INFO] ------------------------------------------------------------------------
以上结果可以看出
①可以看到maven会先分析项目依赖,然后调整编译的顺序,因为mod-test调用了printA, 而printA调用了printB。所以最小构建的是mod2子模块,然后再是mod1子模块。再接着是mod-test...
②maven的phase会在每个子模块里先走完。比如最先构建的是mod2。先在mod2里完整的走一遍maven的几个阶段,走到test阶段的时候会先执行mod2里的测试程序。走到package阶段就会打jar包。上面忘了说了,在mod2的src/main/test里有一个测试的类。有一个方法上加了@Test。
③正因为有了②,所以在build mod2的时候就已经打包好了mod2-0.0.1-SNAPSHOT-tests.jar,所以咱们的 mod3里在构建的时候要解压mod2-0.0.1-SNAPSHOT-tests.jar这个jar包是没问题的。因为人家的确存在呀。 所以这里报jar包不存在只能说是插件有点小瑕疵。不用管他了。
maven在构建的时候有很多阶段。比如下面在mod2中将打包的插件绑定到process-test-classes 阶段也是可以的。因为mod2在mod3之前构建,所以绑定到package或绑定到
process-test-classes 阶段都行。
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
===========================***================================== 下面是mod2中将插件绑定到 process-test-classes 阶段的构建结果,效果是一样的: ===========================***================================== D:\WorkSpace3\parentProj>mvn clean install [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] parentProj [INFO] mod2 [INFO] mod1 [INFO] mod-test [INFO] mod-all [INFO] mod-parent [INFO] mod3 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building parentProj 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ parentProj --- [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ parentProj --- [INFO] Installing D:\WorkSpace3\parentProj\pom.xml to E:\repo\com\lx\parentProj\0.0.1-SNAPSHOT\parentProj-0.0.1-SNAPSHOT.pom [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building mod2 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod2 --- [INFO] Deleting D:\WorkSpace3\parentProj\mod2\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod2 --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod2 --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod2\target\classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod2 --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod2 --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod2\target\test-classes [INFO] [INFO] --- maven-jar-plugin:2.4:test-jar (pack-test-jar) @ mod2 --- [INFO] Building jar: D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT-tests.jar [INFO] [INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod2 --- [INFO] Surefire report directory: D:\WorkSpace3\parentProj\mod2\target\surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running mod2.Mod2Test mod2 测试............ Tests run: 1,Time elapsed: 0.065 sec - in mod2.Mod2Test Results : Tests run: 1,Skipped: 0 [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod2 --- [INFO] Building jar: D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ mod2 --- [INFO] Installing D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod2\0.0.1-SNAPSHOT\mod2-0.0.1-SNAPSHOT.jar [INFO] Installing D:\WorkSpace3\parentProj\mod2\pom.xml to E:\repo\com\lx\mod2\0.0.1-SNAPSHOT\mod2-0.0.1-SNAPSHOT.pom [INFO] Installing D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT-tests.jar to E:\repo\com\lx\mod2\0.0.1-SNAPSHOT\mod2-0.0.1-SNAPSHOT-tests.jar [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building mod1 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod1 --- [INFO] Deleting D:\WorkSpace3\parentProj\mod1\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod1 --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod1 --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod1\target\classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod1 --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod1 --- [INFO] Changes detected - recompiling the module! [INFO] [INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod1 --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod1 --- [INFO] Building jar: D:\WorkSpace3\parentProj\mod1\target\mod1-0.0.1-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ mod1 --- [INFO] Installing D:\WorkSpace3\parentProj\mod1\target\mod1-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod1\0.0.1-SNAPSHOT\mod1-0.0.1-SNAPSHOT.jar [INFO] Installing D:\WorkSpace3\parentProj\mod1\pom.xml to E:\repo\com\lx\mod1\0.0.1-SNAPSHOT\mod1-0.0.1-SNAPSHOT.pom [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building mod-test 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod-test --- [INFO] Deleting D:\WorkSpace3\parentProj\mod-test\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod-test --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod-test --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod-test\target\classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod-test --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod-test --- [INFO] Changes detected - recompiling the module! [INFO] [INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod-test --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod-test --- [INFO] Building jar: D:\WorkSpace3\parentProj\mod-test\target\mod-test-0.0.1-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ mod-test --- [INFO] Installing D:\WorkSpace3\parentProj\mod-test\target\mod-test-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod-test\0.0.1-SNAPSHOT\mod-test-0.0.1-SNAPSHOT.jar [INFO] Installing D:\WorkSpace3\parentProj\mod-test\pom.xml to E:\repo\com\lx\mod-test\0.0.1-SNAPSHOT\mod-test-0.0.1-SNAPSHOT.pom [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building mod-all 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod-all --- [INFO] Deleting D:\WorkSpace3\parentProj\mod-all\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod-all --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory D:\WorkSpace3\parentProj\mod-all\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod-all --- [INFO] No sources to compile [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod-all --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory D:\WorkSpace3\parentProj\mod-all\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod-all --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod-all --- [INFO] No tests to run. [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod-all --- [WARNING] JAR will be empty - no content was marked for inclusion! [INFO] Building jar: D:\WorkSpace3\parentProj\mod-all\target\mod-all-0.0.1-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ mod-all --- [INFO] Installing D:\WorkSpace3\parentProj\mod-all\target\mod-all-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod-all\0.0.1-SNAPSHOT\mod-all-0.0.1-SNAPSHOT.jar [INFO] Installing D:\WorkSpace3\parentProj\mod-all\pom.xml to E:\repo\com\lx\mod-all\0.0.1-SNAPSHOT\mod-all-0.0.1-SNAPSHOT.pom [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building mod-parent 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod-parent --- [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ mod-parent --- [INFO] Installing D:\WorkSpace3\parentProj\mod-parent\pom.xml to E:\repo\com\lx\mod-parent\0.0.1-SNAPSHOT\mod-parent-0.0.1-SNAPSHOT.pom [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building mod3 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mod3 --- [INFO] Deleting D:\WorkSpace3\parentProj\mod-parent\mod3\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mod3 --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory D:\WorkSpace3\parentProj\mod-parent\mod3\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ mod3 --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod-parent\mod3\target\classes [INFO] [INFO] --- maven-dependency-plugin:2.8:build-classpath (generate-cached-classpath) @ mod3 --- [INFO] Wrote classpath file 'D:\WorkSpace3\parentProj\mod-parent\mod3\target\cached_classpath.txt'. [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mod3 --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory D:\WorkSpace3\parentProj\mod-parent\mod3\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ mod3 --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to D:\WorkSpace3\parentProj\mod-parent\mod3\target\test-classes [INFO] [INFO] --- maven-dependency-plugin:2.8:unpack (unpack-common-test-classes) @ mod3 --- [INFO] Configured Artifact: com.lx:mod2:tests:0.0.1-SNAPSHOT:jar [INFO] Unpacking D:\WorkSpace3\parentProj\mod2\target\mod2-0.0.1-SNAPSHOT-tests.jar to D:\WorkSpace3\parentProj\mod-parent\mod3\target\test-classes with includes "" and excludes "" [INFO] [INFO] --- maven-surefire-plugin:2.15:test (default-test) @ mod3 --- [INFO] Surefire report directory: D:\WorkSpace3\parentProj\mod-parent\mod3\target\surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running mod2.Mod2Test mod2 测试............ Tests run: 1,Time elapsed: 0.074 sec - in mod2.Mod2Test Running org.mod3.Mod3Test mod3 测试.................. Tests run: 1,Time elapsed: 0.004 sec - in org.mod3.Mod3Test Results : Tests run: 2,Skipped: 0 [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mod3 --- [INFO] Building jar: D:\WorkSpace3\parentProj\mod-parent\mod3\target\mod3-0.0.1-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ mod3 --- [INFO] Installing D:\WorkSpace3\parentProj\mod-parent\mod3\target\mod3-0.0.1-SNAPSHOT.jar to E:\repo\com\lx\mod3\0.0.1-SNAPSHOT\mod3-0.0.1-SNAPSHOT.jar [INFO] Installing D:\WorkSpace3\parentProj\mod-parent\mod3\pom.xml to E:\repo\com\lx\mod3\0.0.1-SNAPSHOT\mod3-0.0.1-SNAPSHOT.pom [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] parentProj ......................................... SUCCESS [ 0.444 s] [INFO] mod2 ............................................... SUCCESS [ 2.601 s] [INFO] mod1 ............................................... SUCCESS [ 0.285 s] [INFO] mod-test ........................................... SUCCESS [ 0.272 s] [INFO] mod-all ............................................ SUCCESS [ 0.204 s] [INFO] mod-parent ......................................... SUCCESS [ 0.055 s] [INFO] mod3 ............................................... SUCCESS [ 1.846 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.959 s [INFO] Finished at: 2016-10-27T14:13:42+08:00 [INFO] Final Memory: 22M/213M [INFO] ------------------------------------------------------------------------