Maven程序集插件 - 不包括jar文件

时间:2016-03-15 00:23:04

标签: maven maven-assembly-plugin

kacaps * .jar作为依赖项添加,但在构建war文件时,我不希望包含kcaps * .jar,因为它已经在服务器上的运行时共享库​​中。无法添加提供的范围,因为本地设置无法正常工作。 有什么建议吗?

依赖部分                      com.bcbsks             kcaps             $ {} aces.version             提供< /范围> - >             罐

<profiles>
    <profile>
        <id>source</id>
        <build>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.4</version>
                        <configuration>

                        <dependencySets>
                            <dependencySet>
                                <outputDirectory>${webapp.dir}/WEB-INF/lib</outputDirectory>
                                <useProjectArtifact>true</useProjectArtifact>
                                <unpack>true</unpack>
                                <scope>runtime</scope>
                            <unpackOptions>
                                <excludes>
                                    <exclude>**/kcaps*.jar</exclude>
                                </excludes>
                            </unpackOptions>        
                            </dependencySet>
                        </dependencySets>

                        <fileSets>
                            <fileSet>
                                <directory>${webapp.dir}/WEB-INF/lib</directory>
                                <outputDirectory>/</outputDirectory>
                                <useDefaultExcludes>true</useDefaultExcludes>
                                <excludes>
                                    <exclude>**/kcaps*.jar</exclude>
                                </excludes>
                            </fileSet>
                        </fileSets>

                        <!--           <filters>
                                    <filter>${webapp.dir}/WEB-INF/lib/kcaps*.jar</filter>
                                  </filters>         -->    
                        <!--            <excludes>
                                <exclude>${webapp.dir}/WEB-INF/lib/kcaps*.jar</exclude>
                              </excludes>        -->            
                            <webXml>${webapp.dir}/WEB-INF/web.xml</webXml>


                            <descriptorRefs>war-with-dependencies</descriptorRefs>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id> <!-- this is used for inheritance merges -->
                                <phase>package</phase> <!-- bind to the packaging phase -->
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </pluginManagement>
        </build>
    </profile>
</profiles>

0 个答案:

没有答案