Maven并使用旧版应用程序 [英] Maven and working with legacy app

查看:113
本文介绍了Maven并使用旧版应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了使用旧版应用程序框架,我需要将一个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆