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

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

时间: 2024-10-16 05:55:28

Artifact has not been packaged yet. When used on reactor artifact, unpack should be executed after p的相关文章

2.3. maven

2.3.1. 安装 2.3.1.1. Ubuntu $ sudo apt-get install maven2 $ mvn -version Apache Maven 2.2.1 (rdebian-4) Java version: 1.6.0_22 Java home: /usr/lib/jvm/java-6-openjdk/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux" version: &qu

Maven入门--概念与实例

关键名词 Project:任何您想build的事物,Maven都可以认为它们是工程.这些工程被定义为工程对象模型(POM,Poject Object Model).一个工程可以依赖其它的工程:一个工程也可以由多个子工程构成.POM:POM(pom.xml)是Maven的核心文件,它是指示Maven如何工作的元数据文件,类似于Ant中的build.xml文件.POM文件位于每个工程的根目录中.GroupId:groupId是一个工程的在全局中唯一的标识符,一般地,它就是工程名.groupId有利于

IntelliJ IDEA 13试用手记(附详细截图)

从去年开始转java以来,一直在寻找一款趁手的兵器,eclipse虽然是很多java程序员的首选,但是我发现一旦安装了一些插件,workspace中的项目达到数10个以后,经常崩溃,实在影响编程的心情. 今天试用了近年获得众多好评的IntelliJ IDEA 13,感觉焕然一新,记录如下:   一.下载安装 http://www.jetbrains.com/idea/download/ 这是官网的下载地址,支持mac/windows/linux三大主流平台,我今天试用的是mac版本 说明:Int

Maven自定义上传第三方包到3rd party(第三方无依赖jar和本地扩展类加入maven统一管理)

Maven自定义上传第三方包到3rd party(第三方无依赖jar和本地扩展类加入maven统一管理) 注:如果图片太小,则可以下载查看,CSDN,不提供点击放大! 1:用浏览器登陆nexus服务器(此处为本地): http://localhost:8081/nexus/ admin admin123 2:第三方依赖加入: Log in到nexus中,如下图: 3:手动设置填写:GroupId,Artifact,Version: 4:点击:Select Artifact(s) for Uplo

openmeetings源码编译-不知道有没有大神研究openmeetings,使用的是3.0.3版本,使用ant+ivy构建依赖和项目的

问题描述 不知道有没有大神研究openmeetings,使用的是3.0.3版本,使用ant+ivy构建依赖和项目的 ant运行build.xml过程中老出错 <untar src="${red5.server.dir}/target/red5-server-${red5.server.version}-server.tar.gz" dest="${red5.server.dir}/target" compression="gzip"/>

maven-MyEclipse8.5 中 Maven项目报错

问题描述 MyEclipse8.5 中 Maven项目报错 这可怎么办 解决方案 更新maven失败.你看一下,http://maven.oschina.net你能连接上不.是不是你们公司网络限制了.还有就是这个链接是否正确,是否存在. 解决方案二: 公司网络没有限制,链接正确可访问 解决方案三: 配置有问题, http://jingyan.baidu.com/article/4f7d5712aa9c631a201927ea.htmlmyeclipse下maven的配置安装 解决方案四: 试试:

通向架构师的道路(第二十五天)SSH的单元测试与dbunit的整合

一.前言 在二十三天中我们介绍了使用maven来下载工程的依赖库文件,用ant来进行war包的建立.今天我们在这个基础上将使用junit+dbunit来进行带有单元测试报告的框架的架构. 目标: 每次打包之前自动进行单元测试并生成单元测试报告 生成要布署的打包文件即war包 单元测试的代码不能够被打在正式的要布署的war包内,单元测试仅用于unit test用 使用模拟数据对dao层进行测试,使得dao方法的测试结果可被预料 二.Junit+Ant生成的单元测试报告 上面是一份junit生成的测

maven-Maven 项目打包上传服务器的时候出现问题 急急急!

问题描述 Maven 项目打包上传服务器的时候出现问题 急急急! 用下面的命令传到服务器的时候出现了下面的错误,求大神指导 clean package deploy ...... [INFO] --- maven-install-plugin:2.4:install (default-install) @ DEMO --- [INFO] Installing E:WORKDEMOtargetDEMO.jar to C:UsersAdministrator.m2repositorycomcmccd

如何利用Focal Point这一新的OSLC服务提供者能力

随着 Rational Focal Point 6.6 版本的发布,如今 Focal Point 为 Rational 协作生命周期管理解决方案(Rational solution for Collaborative Lifecycle Management,CLM)及其他 OSLC 消费者应用程序提供了 OSLC 服务提供者能力.这篇文章演示了如何利用 Focal Point 这一新的 OSLC 服务提供者能力. 直到现在,IBM® Rational® Focal Point 仍然被认为是只能