You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Alan Czajkowski (Jira)" <ji...@apache.org> on 2020/07/13 20:56:00 UTC

[jira] [Created] (MRESOURCES-260) copy-resources goal copies directories, but not file contents

Alan Czajkowski created MRESOURCES-260:
------------------------------------------

             Summary: copy-resources goal copies directories, but not file contents
                 Key: MRESOURCES-260
                 URL: https://issues.apache.org/jira/browse/MRESOURCES-260
             Project: Maven Resources Plugin
          Issue Type: Bug
          Components: copy
    Affects Versions: 3.1.0
         Environment: Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 11.0.7, vendor: Amazon.com Inc., runtime: /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
            Reporter: Alan Czajkowski


h2. Background

the sample application source code can be found here:
https://gitlab.com/openease/java-microservice-example

this is a peculiar bug that is confusing me because the functionality works sometimes, but not always

my machine:
{code:bash}
$ mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 11.0.7, vendor: Amazon.com Inc., runtime: /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
{code}

The project, mentioned above, is a multi-module project that does a lot of things. One of the modules builds a Spring Boot WAR bundled _together_ with a NPM application:
 [https://gitlab.com/openease/java-microservice-example/-/blob/master/service/www/pom.xml]
 the contents of the NPM build output is copied into the WAR package with the following execution:
{code:xml}
<execution>
  <id>copy-javascript-build-output-to-webapp</id>
  <phase>prepare-package</phase>
  <goals>
    <goal>copy-resources</goal>
  </goals>
  <configuration>
    <resources>
      <resource>
        <directory>${project.build.directory}/javascript/build</directory>
        <filtering>false</filtering>
        <includes>
          <include>**/*.css*</include>
          <include>**/*.htm*</include>
          <include>**/*.js*</include>
          <include>**/*.png*</include>
          <include>**/*.svg*</include>
          <include>**/*.txt*</include>
        </includes>
      </resource>
    </resources>
    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes/public</outputDirectory>
  </configuration>
</execution>
{code}

h2. Problem

This execution works fine when you run:
{code:bash}
$ cd service/www/
$ mvn clean prepare-package
{code}
it copies over all of the NPM build output contents (directories and files)

but this execution fails when you run:
{code:bash}
$ cd service/www/
$ mvn clean install
{code}
it copies over only the directory structure, but no files:
{code}
${project.build.directory}/
  ${project.build.finalName}/
    WEB-INF/
      classes/
        public/ (no files)
          static/
            css/ (no files)
            js/ (no files)
            media/ (no files)
{code}

I believe the other executions defined in the {{pom.xml}} don't seem to have a problem, just this one ...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)