在 pom.xml 中包含 maven 项目中的所有资源

Include all resources in maven project in pom.xml

我需要在 pom.xml 中包含所有资源,但我没有成功。事实上,我正在尝试这段代码,但我认为它不适用于所有资源

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.4.1</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <shadedArtifactAttached>true</shadedArtifactAttached>
                <shadedClassifierName>project/classifier</shadedClassifierName>
                <outputFile>shade${project.artifactId}.jar</outputFile>
                <transformers>
                    <transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                        <mainClass>fr.tse.fise2.pip.graphic.Main</mainClass>
                    </transformer>
                </transformers>
            </configuration>
        </execution>
    </executions>
</plugin>

我需要在名为 pip 的项目中包含我的所有资源。

错误,这是正确的,因为我在 pom.xml 中包含的内容不包含 src/main/resources 并且 main 无法访问此文件夹中的文件

enter image description here

网站图标应位于 src/main/resources 或子文件夹中。

如果您不想将其保留在那里,您可以使用 maven-resources-plugin

复制它