Rob Audenaerde created MRESOURCES-313:
-----------------------------------------
Summary: Debug says 'copy' but does not do that when overwrite =
false
Key: MRESOURCES-313
URL: https://issues.apache.org/jira/browse/MRESOURCES-313
Project: Maven Resources Plugin
Issue Type: Bug
Reporter: Rob Audenaerde
I have this configuration (that now works). If I leave out the `overwrite`, it
does not always work. I think this is due to timing of the created files in the
first step. The debug output however is always the same (when running mvn -X),
so even when not copying the file, it *incorrecly* states the copy command.
{code:java}
DEBUG] Copying file swagger-initializer.js
[DEBUG] file swagger-initializer.js has a filtered file extension
[DEBUG] Using 'UTF-8' encoding to copy filtered resource
'swagger-initializer.js'.
[DEBUG] copy
/home/raudenaerde/IdeaProjects/searchdata-api/swagger-ui-config/swagger-initializer.js
to
/home/raudenaerde/IdeaProjects/searchdata-api/target/swagger-ui/META-INF/resources/webjars/swagger-ui/5.18.3/swagger-initializer.js
{code}
{code:java}
<plugin>
<!-- Download Swagger UI webjar. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.dependency.version}</version>
<executions>
<execution>
<id>properties-for-mockito</id>
<goals>
<goal>properties</goal>
</goals>
</execution>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>${swagger.ui.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/swagger-ui</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- Copy files from swagger-ui-config to enable logging in via Keycloak -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.version}</version>
<executions>
<execution>
<id>copy-swagger-ui-config</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger.ui.version}
</outputDirectory>
<resources>
<resource>
<filtering>false</filtering>
<directory>swagger-ui-config</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
</plugin> {code}
</plugin>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)