我面临的情况是我需要使用不同的依赖集构建不同的war,可以在Tomcat 7和WebSphere 8下部署(WebSphere自己提供大量的依赖项),我正在寻找最好的方法。
您如何在现实世界的项目中处理这种情况?我错过了什么?
答案 0 :(得分:0)
装配完成工作:
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>websphere8</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>war</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.build.directory}/${project.build.finalName}</directory>
<outputDirectory></outputDirectory>
<excludes>
<exclude>WEB-INF/lib/*.jar</exclude>
</excludes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>WEB-INF/lib</outputDirectory>
<useTransitiveFiltering>true</useTransitiveFiltering>
<excludes>
<exclude>javax.ws.rs:jsr311-api:*</exclude>
<exclude>org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:*</exclude>
<exclude>xml-apis:xml-apis:*</exclude>
<exclude>xerces:xercesImpl:*</exclude>
<exclude>org.hibernate.javax.persistence:hibernate-jpa-2.0-api:*</exclude>
<exclude>org.ow2.jotm:jotm-core:*</exclude>
<exclude>org.glassfish.hk2.external:javax.inject:*</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>