I'm trying to get maven to copy some resources (specifically a master.css file) from a Core module into all modules that depend on it.
I'm attempting to use the first answer on this question: Use a dependency's resources? :
<build>
<plugins>
<!--Extract core's resources-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>unpack</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>${project.groupId}</includeGroupIds>
<includeArtifactIds>core</includeArtifactIds>
<excludeTransitive>true</excludeTransitive>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/core-resources</outputDirectory>
<excludes>org/**,META-INF/**,rebel.xml</excludes>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<!--New resource locations-->
<resources>
<resource>
<filtering>false</filtering>
<directory>${project.build.directory}/core-resources</directory>
</resource>
<resource>
<filtering>false</filtering>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
I put this code in the pom.xml file for Core (not the parent project -- is that right?)/ But I'm having trouble with it -- I am unsure I'm doing everything correctly. I do not see anything copied over in the target directories of the modules that depend on Core.
Here is the output of that part when I mvn clean install:
--- maven-dependency-plugin:2.1:unpack-dependencies (unpack) @ Core ---
--- maven-resources-plugin:3.0.2:resources (default-resources) @ Core ---
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory {project-directory}\Core\target\core-resources
Copying 16 resources
where {project-directory} is the full path to my project.
My core resources folder looks like this:
src/main/resources
/core-resources
master.css
/fxml
~some stuff~
/imgs
~some stuff~
/styles
~some stuff~
I do not see anything copied over in the target directories of the modules that depend on Core.
Basically, I have 3 questions:
Where is it copying from?
Where is it copying to?
Why isn't it copying anything right now?
If there's any other information that's needed I can provide that. I'm not very good at maven and honestly the maven docs are Greek to me. I'm probably misunderstanding something important about maven so if something sounds weird please tell me.