0

So I'm having a problem with sharing a resources root because of IntelliJ, We have some resources we already add with the resource plugin, some of these resources I do not want to overwrite for performance reasons. In other cases I would like them overwritten So we don't forget we have to delete them if we change them. Can I just specify (mostly copy-pasta-ed from the official documentation

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <!-- here the phase you need -->
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/extra-resources</outputDirectory>
              <resources>          
                <resource>
                  <overwrite>true</overwrite> <!-- will this work -->
                  <directory>src/non-packaged-resources</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>              
            </configuration>            
          </execution>
        </executions>
      </plugin>
    </plugins>

in the resources I want to overwrite? really this question is simple Can I put overwrite directly on the resource? Will it work?

xenoterracide
  • 16,274
  • 24
  • 118
  • 243
  • Can you explain more detail what kind of problem you have and best would be an example project? – khmarbaise Jan 25 '21 at 23:51
  • @khmarbaise https://youtrack.jetbrains.com/issue/IDEABKL-6745 I'm having this problem. In order to reproduce the problem I'd have to hand out a full git repo with tons of intellij files committed, it would be a lot of code to look at for literally no benefit to asking the question. *"DOES `` support `` directly"*, everything else is a tangent. The reason why it would be mixed is we copy an h2 database over for performance reasons, so overwriting it every time would result in not gaining the performance benefits (I think, I should take a double look). – xenoterracide Jan 26 '21 at 16:41
  • I was looking to achieve the same but unfortunately overwrite doesn't work at resource level and I get this error. Were you able to achieve this @xenoterracide? ``` [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:copy-resources (move-maven-runner-to-root-dir) on project test-project: Unable to parse configuration of mojo org.apache.maven.plugins:maven-resources-plugin:3.2.0:copy-resources for parameter overwrite: Cannot find 'overwrite' in class org.apache.maven.plugins.resources.Resource -> [Help 1] ``` – Motivated Mind May 17 '22 at 13:56

0 Answers0