Maven并使用旧版应用程序 [英] Maven and working with legacy app
问题描述
为了使用旧版应用程序框架,我需要将一个webapp项目拆分为2个.1个jar需要具有Java类文件,另一个需要所有的Web东西,例如jsps,css等. al ..如何在maven-3 pom上执行此操作?
In order to work with a legacy app framework I need to split a webapp project into 2. 1 jar needs to have the java class files, the other will have all the web stuff like jsps, css, et. al.. How can I do this with on maven-3 pom?
推荐答案
For this purpose you can use the configuration of the maven-war-plugin. This will create a separate jar file which contains the .class files...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<attachClasses>true</attachClasses>
</configuration>
</plugin>
像xyz-1.0.0-SNAPSHOT-classes.jar一样,可以用作单独的依赖项(必须使用补充分类器).
like xyz-1.0.0-SNAPSHOT-classes.jar which can be used as a separated dependency (you have to use the supplemental classifier).
If the war artifact should not contain any classes, you can achieve this by adding the packagingExcludes configuration.
<packagingExcludes>WEB-INF/classes/**</packagingExcludes>
这篇关于Maven并使用旧版应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!