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
1
vote
0 answers

NPE: Execution copy-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources failed

Note: before someone mark this issue as duplicate please note I have already read and tried solutions suggested in following similar threads which did not work for me: Maven:Failed to execute goal…
Rav
  • 11
  • 3
1
vote
0 answers

filter maven properties using profile-dependent properties file

I'm using the properties-maven-plugin to load properties from a custom properties file. The properties file name depends on the selected build profile. org.codehaus.mojo
user35934
  • 374
  • 2
  • 13
1
vote
1 answer

how does copy-resources work

I tried using maven-resources-plugin with goal copy resources.It copied all the resources to the output directory.I needed only a single jar.How to make it possible?
Sushma
  • 81
  • 1
  • 5
1
vote
0 answers

Maven Release Plugin and Resources

Is it possible to configure the maven release plugin to include unversioned resources in the main jar? I have a static folder under src/main/resources where I output my packaged Javascript file that is ignored by git. I have tried to use a profile…
1
vote
1 answer

Custom MavenResourcesFiltering hard to implement?

I’d like to write a custom resource filter for some source files, in order to prepend a line // @sourceURL= during resource filtering, where is the path of the file relative to ${project.basedir}. I followed Maven…
jfrantzius
  • 623
  • 7
  • 16
1
vote
1 answer

Maven Resources and docker-maven-plugin

I would like to understand better how Maven deals with resources and in particular how plugins can reuse the Resources infrastructure that Maven provides: I have already read the resources section of Maven and looked at the Maven Resources…
lanoxx
  • 12,249
  • 13
  • 87
  • 142
1
vote
2 answers

What determines the Maven plugins versions in the section of pom.xml?

I'm using Eclipse Kepler with M2E. I've created an empty Eclipse project, directly converted to a Maven project. The pom.xml is cleaned: no dependency or build section, no parent POM. The Maven settings.xml is the default one: no info included.…
ThCollignon
  • 976
  • 3
  • 14
  • 31
1
vote
1 answer

Spring boot - Maven - Exclude folder not working

I have a spring boot app and the project structure is as follows. project |__src/main/java |__src/main/resources |_static | |_css | |_fonts | |_node_modules | |_src |_templates I would like…
user1578872
  • 7,808
  • 29
  • 108
  • 206
1
vote
1 answer

Maven resource filtering - Explicitly specify which files require property injection

Does the Maven resources plugin allow a flexible way to exclude certain files during the injection of Maven profile properties? I don't want to exclude the files from assembly, just from the injection phase. The project I'm working on defines…
cdugga
  • 3,849
  • 17
  • 81
  • 127
1
vote
1 answer

How to expand Maven properties in all files within src/main/webapp?

I'd like to include some Maven properties(*) in src/main/webapp/META-INF/context.xml. (*) E.g. ${data-source-name}, ${data-source-factory}, ${jdbc-connection-url} etc. - but in the words of the late, great Leslie Nielsen, that's not important right…
Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
1
vote
1 answer

Maven plugin to include all jar files and exclude all config files

I have searched for a plugin/sets of plugins for maven to include all the dependencies in a jar file except configuration files in resources folder. I found assembly plugin a good solution for including all the assembly, and using the resources and…
1
vote
1 answer

Move one test resource to somewhere on disk in Maven

I have a test resource that lives in resources/src/test/dir/sample.json, and it needs to move to /tmp/data/sample.json before unit tests can run. I want to use Maven to automate moving this file, without interfering with other test resources that…
djechlin
  • 59,258
  • 35
  • 162
  • 290
1
vote
0 answers

Plugin to compile an index of Java resource files using Maven

I'm looking for a fast and container-agnostic way of iterating resources files in my .jar. It seems like the most straightforward solution is to simply generate a listing of these files during the compile phase, but strangely, I haven't found a…
Ryan
  • 1,171
  • 1
  • 10
  • 23
1
vote
2 answers

Overwrite property in Maven Without Tokenization

I would like to set a property in Maven, but also read a sensible default when running the application without Maven. Currently I have a property file which looks like this: baseUrl=${baseUrl} Using the maven-resources-plugin, I can then filter…
user1735096
  • 183
  • 1
  • 2
  • 8
1
vote
2 answers

Why are image files not copied by the maven-resources-plugin?

I am minifying and aggregating my css files using the YUICompressor maven plugin which creates a single css file at the base of my resources directory. These original css files are nested inside some folders which also have an "images" folder at…
Noremac
  • 3,445
  • 5
  • 34
  • 62