apache / apache/maven-resources-plugin

[MRESOURCES-280] Test resources are copied into production WAR file

Open
#329 1 comment 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
61
Forks
36
Avg merge
1d 1h
Merged PRs (30d)
3

Description

**[Dries Elliott](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER283168)** opened **[MRESOURCES-280](https://issues.apache.org/jira/browse/MRESOURCES-280?redirect=false)** and commented

When specifying an `outputDirectory` for the Maven Resources plugin, as shown below we are seeing some weird behavior in the plug-in.

```java

org.apache.maven.plugins
maven-resources-plugin

${project.build.outputDirectory}


```

When running a build with `{}mvn clean install{`}, we notice that our test resources from `src/test/resources` end up in the final WAR file that is created. It seems strange to us that test resource files would end up in a WAR file that will later on be deployed to production.

Commenting out the `outputDirectory` in the above example, resolves the issue and the test resources end up in the correct place again.

Why does setting `outputDirectory` to the same its default value explicitly cause this behavior? (see https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html) Is this a bug?

---

**Affects:** 3.2.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.