1
我試圖通過名稱檢索maven-dependecy-plugin中的神器項目作爲一個屬性,在我的戰爭清單文件中寫入它的值。 我需要類似${project.artifactItems["name"].value}
來檢索我的值,而不必將每個jar清單文件作爲流程programmaticaly讀取。檢索神器項目作爲屬性
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-installed</id>
<phase>test</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>prj-applet</artifactId>
<version>${test.project.version}</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>prj-pdf-render-applet</artifactId>
<classifier>jar-with-dependencies</classifier>
<version>${test.project.version}</version>
<type>jar</type>
</artifactItem>
</artifactItems>
我需要用戰爭插件在我的清單文件中插入每個檢索到的值:
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>test</warName>
<!-- Java EE 6 doesn't require web.xml, Maven needs to catch up! -->
<!-- <warName>test</warName> -->
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifestEntries>
<applicationVersion>${pom.version}</applicationVersion>
<applicationBuildTimestamp>${maven.build.timestamp}</applicationBuildTimestamp>
</manifestEntries>
</archive>
</configuration>