Answer the question
In order to leave comments, you need to log in
How to set Maven to copy at build time?
There are directories outside the Java project. These are not resources (they must be copied to a directory other than target\classes).
Maven builds the Jar into target\jfx .
Upon completion of the build via maven, it is necessary that they be copied, that is, we specify SourceDir= ~/fluent/mapGr + DestinationDir={project.basedir}/target/jfx/speedmap and forward.
Thank you.
Answer the question
In order to leave comments, you need to log in
This is done using plugins. Here is a choice of antrun and maven-resources-plugin:
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<configuration>
<tasks>
<copy todir="${project.basedir}/target/jfx/speedmap">
<fileset dir="/home/fluent/mapGr"/>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-resources-foreign</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/target/jfx/speedmap</outputDirectory>
<resources>
<resource>
<directory>/home/fluent/mapGr</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
There are directories outside the Java project. These are not resources (they must be copied to a directory other than target\classes).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question