我的應用程序依賴於第三方耳朵(它解構它,添加/修改其中的某些項目,並將其重構爲新耳朵)。第三方耳朵必須使用第三方構建腳本構建。使用外部構建腳本的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