我有一個eclipse項目,它有另一個項目的引用。
爲了在eclipse工作區中定義的服務器上進行部署,我在「屬性」 - >「Java構建路徑」和「屬性」 - >「部署程序集」中包含了這個其他項目。
此配置包含WEB-INF/lib目錄中的外部項目的jar。在maven生成的war中包含外部的eclipse項目作爲jar
現在我想用(右鍵單擊)「Run As」 - >「Maven install」命令生成一個war文件。
我已經添加了Maven的戰爭插件插件的POM:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webappDirectory>${project.build.directory}/${project.artifactId}</webappDirectory>
<warName>${project.artifactId}_${noVer}</warName>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<addClasspath>false</addClasspath>
</manifest>
<manifestEntries/>
<manifestFile/>
</archive>
</configuration>
</plugin>
是否有可能包括其他項目作爲一個jar(自動)的戰爭嗎?
謝謝。
EDIT
「其它項目」 是在相同的工作區中的蝕項目。
其實是一個maven jar項目。
如前所述,它包含在原始項目中。
我想知道的是:
有沒有一種方法(plugin,directive ...)將這個ECLIPSE項目直接包含在原始項目的pom中?
像
<dependency>
<groupId>org.myproject</groupId>
<artifactId>other_eclipse_project</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
,然後找到在WEB-INF/lib目錄
我知道「其他項目」不是maven項目。正確? – JimHawkins
應該是另一個eclipse maven項目 – notting65