Questions tagged [maven-resources-plugin]

The Maven Resources Plugin handles the copying of project resources to the output directory.

There are two different kinds of resources: main resources and test resources. The difference is that the main resources are the resources associated to the main source code while the test resources are associated to the test source code. Thus, this allows the separation of resources for the main source code and its unit tests. Starting with version 2.3 this plugin uses the Maven Filtering shared component for filtering resources.

188 questions
62
votes
19 answers

Maven clean install: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources

I don´t know what´s the problem. Trying to install maven for a college project. I already installed maven as instructed here. Picture Environmental Variables, maven version in cmd And I also tried to delete the .m2 file. When I try to install maven…
CodingStudent
  • 776
  • 1
  • 5
  • 10
37
votes
1 answer

How do I filter test resources in maven?

I have the following pom.xml. When I run mvn clean resources:testResources, my test resources aren't being filtered (replacing placeholders in resources before they are put, in their modified form, into the output folder). Why?
Heath Borders
  • 30,998
  • 16
  • 147
  • 256
34
votes
3 answers

Maven: how to place resource file together with jar?

I have \src\main\resources\logback.xml file. When I run mvn package it is placed into the jar by default. How do I make Maven place it next to jar, not inside? So, well, I just want Maven to copy the resource to the same folder where jar will be.
Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
29
votes
3 answers

Keep permissions on files with Maven resources:testResources

Is it possible to keep permissions on file with Maven resources:testResources? My use case is a Selenium binary driver that I put in /src/test/resources that I would like to be able to use from my tests. My -rwxr-xr-x is however changed to…
Viktor Hedefalk
  • 3,572
  • 3
  • 33
  • 48
28
votes
2 answers

.gitignore file is not copied to archetype JAR - Workarounds?

Currently in the maven-resources-plugin there is a bug that the .gitignore file is not copied to the archetype JAR. See this bug report Short and simple question: are there workarounds for getting the file in the archetype? Edit: setting the…
Charmin
  • 711
  • 20
  • 30
20
votes
3 answers

maven-resources-plugin error using copy-resources goal: 'resources', 'outputDirectory' missing or invalid

I'm trying to use the maven-resources-plugin to do some filtering using the copy-resources goal, and ran into the following error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:copy-resources (default-cli) on project…
Andy Dennie
  • 6,012
  • 2
  • 32
  • 51
15
votes
2 answers

Maven Resources Plugin symbolic link handling

In the src/test/resources folder of a maven project there's a relative symbolic link. With the 2.6 version of the plugin, the actual file is copied. After updating to the 3.0.1 version, it copies the link instead of the file and on a subsequent run…
Bax
  • 4,260
  • 5
  • 43
  • 65
12
votes
2 answers

Maven : add external resources

I am building an executable jar file with maven, meaning that you run it with "java -jar file.jar". I want to rely on user defined properties (just a file containing keys/values), during developpement phase I was putting my "user.properties" file in…
11
votes
3 answers

Maven resources plugin filtering not working

I have a POM with the following in: xxxxxxxxxx ${project.artifactId}-${project.version}
fhcat
  • 971
  • 2
  • 9
  • 28
9
votes
2 answers

Maven Resource Filtering with Profile Properties

I have the following pom.xml:
johnmcase
  • 1,769
  • 2
  • 16
  • 27
9
votes
1 answer

Copying a single file then renaming it using maven-resources-plugin -- possible?

I copy a single WSDL file from a different project tree, using maven-resources-plugin, as follows: copy-wsdl-and-rename-it validate copy-resources
Withheld
  • 4,603
  • 10
  • 45
  • 76
9
votes
1 answer

Maven randomly does not filter resources

This is kind of maddening, and I've never seen it happen before in several years of working with Maven. A single, simple project (that I did not write myself) will randomly fail to filter resources, and I cannot figure out what might cause it. I…
monitorjbl
  • 4,280
  • 3
  • 36
  • 45
8
votes
2 answers

How to ignore missing filter file error on pom.xml in Eclipse when using resource filtering?

I have a multi-module project like this: parent | +-- childA | +-- src/main/resources/application.properties | +-- childB +-- src/main/resources/application.properties +-- src/main/filters/filter.properties I am filtering the…
Zack
  • 3,819
  • 3
  • 27
  • 48
8
votes
4 answers

Maven build is not filtering properties in Intellij

I am having an issue where when I run by Maven build from Intellij 15.0.2 the Maven Resources Plugin is not filtering my properties into my files. It does work when I run mvn compile from the Windows command line. My plugin config is:
nash
  • 3,020
  • 6
  • 38
  • 53
8
votes
2 answers

Apache Maven Resources Plugin exclude a directory

I'm trying to copy some resources from one point to an other during the build process. Therefore I use the Apache Maven Resources Plugin. Actually I exclude some files, I don't need. But I want also to exclude a directory. I tried serveral ways but…
kdoteu
  • 1,527
  • 1
  • 20
  • 26
1
2 3
12 13