Artifact has not been packaged yet. When used on reactor artifact, unpack should be executed after p

简介: 最初在titan的源码里看到这个错误的。搜了一下这个错是eclipse的插件m2e的问题。不是真正的错误。 这是验证代码。这个验证代码可以让你更加了解多模块工程时maven会智能的决定最先构建哪个模块。

最初在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

printA里调用了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, Failures: 0, Errors: 0, 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, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec - in mod2.Mod2Test
Running org.mod3.Mod3Test
mod3 测试..................
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in org.mod3.Mod3Test


Results :


Tests run: 2, Failures: 0, Errors: 0, 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, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.065 sec - in mod2.Mod2Test


Results :


Tests run: 1, Failures: 0, Errors: 0, 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, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.074 sec - in mod2.Mod2Test
Running org.mod3.Mod3Test
mod3 测试..................
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec - in org.mod3.Mod3Test


Results :


Tests run: 2, Failures: 0, Errors: 0, 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] ------------------------------------------------------------------------





目录
相关文章
|
数据处理 Python
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
1788 0
|
人工智能 Java API
MCP客户端调用看这一篇就够了(Java版)
本文详细介绍了MCP(Model Context Protocol)客户端的开发方法,包括在没有MCP时的痛点、MCP的作用以及如何通过Spring-AI框架和原生SDK调用MCP服务。文章首先分析了MCP协议的必要性,接着分别讲解了Spring-AI框架和自研SDK的使用方式,涵盖配置LLM接口、工具注入、动态封装工具等步骤,并提供了代码示例。此外,还记录了开发过程中遇到的问题及解决办法,如版本冲突、服务连接超时等。最后,文章探讨了框架与原生SDK的选择,认为框架适合快速构建应用,而原生SDK更适合平台级开发,强调了两者结合使用的价值。
14637 33
MCP客户端调用看这一篇就够了(Java版)
|
数据库 Android开发 开发者
Android常用的room增删改查语句(外部数据库)
本文分享了将一个原生数据库驱动的单词APP重构为使用Room库的过程及遇到的问题,重点解决了Room中增删改查的常用语句实现。文章通过具体示例(以“forget”表为例),详细展示了如何定义实体类、Dao接口、Database类以及Repository和ViewModel的设计与实现。同时,提供了插入、删除、更新和查询数据的代码示例,包括模糊查询、分页加载等功能。此外,针对外部数据库导入问题,作者建议可通过公众号“计蒙不吃鱼”获取更多支持。此内容适合有一定Room基础的开发者深入学习。
398 0
Android常用的room增删改查语句(外部数据库)
|
存储 SQL 监控
淘宝闪购实时分析黑科技:StarRocks + Paimon撑起秋天第一波奶茶自由
本文介绍了饿了么数据团队在淘宝闪购项目中,通过 StarRocks 与 Paimon 构建实时湖仓架构,实现分钟级数据分析与决策。面对高并发与海量数据挑战,团队采用物化视图优化、RoaringBitmap 去重及大查询治理等技术手段,显著提升实时分析性能,支撑亿级营销与多端流量下的实时业务需求。
|
SQL 存储 数据库
Flink + Paimon 数据 CDC 入湖最佳实践
Flink + Paimon 数据 CDC 入湖最佳实践
3439 59
|
安全 Java 编译器
深入理解Java中synchronized三种使用方式:助您写出线程安全的代码
`synchronized` 是 Java 中的关键字,用于实现线程同步,确保多个线程互斥访问共享资源。它通过内置的监视器锁机制,防止多个线程同时执行被 `synchronized` 修饰的方法或代码块。`synchronized` 可以修饰非静态方法、静态方法和代码块,分别锁定实例对象、类对象或指定的对象。其底层原理基于 JVM 的指令和对象的监视器,JDK 1.6 后引入了偏向锁、轻量级锁等优化措施,提高了性能。
914 3
|
存储 缓存 NoSQL
一篇搞懂!Java对象序列化与反序列化的底层逻辑
本文介绍了Java中的序列化与反序列化,包括基本概念、应用场景、实现方式及注意事项。序列化是将对象转换为字节流,便于存储和传输;反序列化则是将字节流还原为对象。文中详细讲解了实现序列化的步骤,以及常见的反序列化失败原因和最佳实践。通过实例和代码示例,帮助读者更好地理解和应用这一重要技术。
1026 0
|
监控 Java 数据库连接
Java一分钟之-JDBC连接池:HikariCP, Apache DBCP, C3P0
【6月更文挑战第14天】本文介绍了Java中常用的三种JDBC连接池——HikariCP、Apache DBCP和C3P0。HikariCP以其高性能和低延迟领先,适合高并发环境;Apache DBCP稳定易配置;C3P0则提供高度可定制选项。文章讨论了各连接池的常见问题及避免策略,如配置不当、连接泄露等,并给出示例代码以供参考。选择合适的连接池并正确配置能有效提升应用性能。
906 7
|
Oracle 关系型数据库 MySQL
Flink CDC数据同步问题之丢失update操作如何解决
Flink CDC数据同步是指利用Flink CDC实现不同数据源之间的实时数据同步任务;本合集旨在提供Flink CDC数据同步的操作指南、性能优化建议和常见问题处理,助力用户高效实施数据同步。

热门文章

最新文章