使用maven-shade-plugin排除路径

时间:2015-08-30 13:48:54

标签: java maven maven-shade-plugin

我是maven-shade-plugin的新人,对基本问题感到遗憾。我想将带有maven-shade-plugin的路径排除到我的src / main / resources下的目录。意思是代替示例中的所有xml,我想要路径到src / main / resources

我该怎么做?

     <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>1.4</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
                <configuration>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <manifestEntries>
                                <addClasspath>true</addClasspath>
                                <mainClass>cosa.Main</mainClass>
                                <classpathPrefix>dependency-jars/</classpathPrefix>
                            </manifestEntries>
                        </transformer>
                    </transformers>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>*.xml</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
            </execution>
        </executions>
        <configuration>
            <finalName>cosa-data-population</finalName>
        </configuration>
    </plugin>

0 个答案:

没有答案