0

I have a maven-war-plugin configured in my pom.xml. Like this:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>${maven-war-plugin.version}</version>
    <configuration>
      <failOnMissingWebXml>false</failOnMissingWebXml>
      <webResources>
        <resource>
          <!-- this is relative to the pom.xml directory -->
          <directory>${project.basedir}/dist</directory>
          <targetPath>${project.basedir}/app/ui</targetPath>
        </resource>
      </webResources>
    </configuration>
  </plugin>

But when I run it, I get the error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.4.0:war (default-war) on project gid-webpack: Could not copy resource [C:\Users\sam2004\git\GID\develop\develop\gid-webpack/dist]: The filename, directory name, or volume label syntax is incorrect -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.4.0:war (default-war) on project gid-webpack: Could not copy resource [C:\Users\sam2004\git\GID\develop\develop\gid-webpack/dist]
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)

First I thought it was the / that was the problem for the <directory> value. So I switched it to a \. But still seeing the same error.

The folder does exist. So its a bit confusing, why is maven not able to pick it up. Any pointers would be helpful.

6
  • Have you tried the -X flag for debug output? Commented Oct 27 at 11:27
  • @JFMeier Yes i did. I went through it, but it didn't give me anything of note. Mostly generic debug outputs. Commented Oct 27 at 13:07
  • @JFMeier I switched to just <directory>/dist</directory> and it worked. Did I just catch a bug in the plugin? Commented Oct 27 at 13:29
  • Your actual path C:\Users\sam2004\git\GID\develop\develop\gid-webpack/dist looks strange because it contains develop twice. Commented Oct 27 at 14:21
  • Yeah. It is like that, I mistakenly created the folder with the same name twice. Just felt lazy not to change it. But don’t think the path is the problem. Commented Oct 27 at 14:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.