我的应用程序依赖于第三方耳朵(它解构它,添加/修改其中的某些项目,并将其重构为新耳朵)。第三方耳朵必须使用第三方构建脚本构建。使用外部构建脚本的maven
我想学习“maven-y”方法来设置它。我希望我需要将第三方的耳朵安装到我的仓库中。
我想为第三方耳朵创建一个pom.xml,它将构建第三方耳朵并安装/部署它。我创建了一个pom.xml,它可以成功地调用第三方构建脚本(通过maven-antrun-plugin),并在默认的Maven Ear项目中创建耳朵。
我的问题是,maven的安装插件失败,因为它无法找到存档(它期望任何插件包装有工件对象上设置一个属性,而maven-antrun-plugin不这样做)。
mvn package
工作正常,并生成耳朵。
确切的错误信息运行mvn install
时看起来是这样的:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install (default-install) on project third_party_ear: The
packaging for this project did not assign a file to the build artifact -> [Help 1]
有没有一种更好的方式去这件事吗?
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.thirdparty</groupId>
<artifactId>third_party_ear</artifactId>
<version>9.0</version>
<packaging>ear</packaging>
<name>third_party_ear</name>
<build>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-ear</id>
<phase>none</phase>
</execution>
<execution>
<id>default-generate-application-xml</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<subant target="build-ear" antfile="build.xml" buildpath="${project.basedir}"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
这看起来完成了工作。 pom 和似乎是我失踪。感谢上帝为maven mavens。感谢您的及时答复。 –
Warren