Maven解包依赖项

时间:2016-03-09 01:12:43

标签: maven

我的POM中有一个依赖zip和jar文件,并且在同一个POM中有unpack-dependencies插件。现在,当我尝试构建时,我会遇到属于这些zip和jar的缺少类的编译错误。可以是zip和jar中的这些类仍然没有解压缩并且在解压缩之前执行编译吗? 有没有人遇到类似的问题?任何解决方案赞赏 我可以将输出目录中的文件解压缩为jsr,但是maven build无法看到它,因为它不在存储库中并且编译失败。

我的POM看起来像这样

<dependencies>
    <dependency>
      <groupId>abc.xyx.com.prov</groupId>
      <artifactId>myArtifactId</artifactId>
      <version>2.1</version>
      <type>zip</type>
    </dependency>
    </dependencies>

    <build>
    <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                  <execution>
                    <id>unpack</id>
                    <phase>process-resources</phase>
                    <!-- <phase>package</phase> -->
                    <goals>
                        <goal>unpack</goal>
                    </goals>
                  </execution>
                </executions>
                <configuration>
                <artifactItems>
                    <artifactItem>
                        <groupId>abc.xyx.com.prov</groupId>
                        <artifactId>myArtifactId</artifactId>
                        <type>zip</type>
                        <includes>**/*.jar</includes> 
                        <version>2.1</version>
                        <outputDirectory>target/lib</outputDirectory>
                        </artifactItem>
                    </artifactItems>    
                </configuration>
            </plugin>
    </plugins>
</build>

0 个答案:

没有答案