Maven and working with legacy app

做~自己de王妃 提交于 2020-01-03 04:55:11

问题


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?


回答1:


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>

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>


来源:https://stackoverflow.com/questions/9415453/maven-and-working-with-legacy-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!