2

我想 在 mvn 包目标期间将位于myjar.jar:META_INF/public-resource/myresource.sk中的依赖项 jar 中的资源添加到我的webapp/WEB-INF/myfolder中。有没有人可以提供建议,如何做到这一点?

4

1 回答 1

9

如果 myjar 在 mvn 存储库中,就像它应该的那样,就像

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>unpack</id>
                    <phase>package</phase>
                    <goals>
                        <goal>unpack</goal>
                    </goals>
                    <configuration>
                       <artifactItems>
                         <artifactItem>
                            <groupId>mygroupid</groupId>
                            <artifactId>myjar</artifactId>
                            <outputDirectory>src/main/webapp/WEB-INF/myfolder</outputDirectory>
                            <includes>META_INF/public-resource/myresource.sk</includes>
                          </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
 </build>
于 2013-09-02T05:58:05.413 回答