Home > database >  Maven resources plugin disable default packing of /src/resources/
Maven resources plugin disable default packing of /src/resources/

Time:11-15

I have a maven project in eclipse and want to use the mave-resources-plugin to pack my resources to a jar. I managed to pack it as I like, but have one issue remaining: the 'default-resources' execution is packing unnecessary files to wrong places. Is there a way to supress the execution of the default-resources and only use the defined packing instructions? here is the part, where I use the resource-plugin in pom.xml

<!--           PACK MODULES           -->
<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.1.0</version>
    <executions>
        <execution>
            <id>pack-modules</id>
            <phase>compile</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <outputDirectory>${project.build.outputDirectory}/modules/${project.artifactId}</outputDirectory>
                <resources>
                    <resource>
                        <directory>src/main/webapp/modules/${project.artifactId}</directory>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>

CodePudding user response:

One could just simply bind the default-resource to lifecycle 'none':

<execution>
 <id>default-resources</id>
 <phase>none</phase>
</execution>
  • Related