The project consists of

myProject/src/myClasses/<all_java_classes.java> //Все классы проекта myProject/data/myDb.db //База данных myProject/config.properties //Файл проперти 

Pom.xml itself

 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>ngrmr</groupId> <artifactId>myProject</artifactId> <packaging>jar</packaging> <version>1.0</version> <name>OART</name> <url>http://maven.apache.org</url> <build> <directory>out/maven_build</directory> <outputDirectory>myProject/out/classes</outputDirectory> </build> </project> 

The final build, as you see, happens in out / maven_build

How can I supplement the pom.xml file so that the database file and the * .perperties file remain unchanged in the out folder?

    1 answer 1

    You can use the maven resources-plugin

     <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.7</version> <executions> <execution> <id>copy-resources</id> <phase>validate</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.basedir}/out</outputDirectory> <resources> <resource> <directory>${project.basedir}</directory> <includes> <include>config.properties</include> </includes> <filtering>false</filtering> </resource> <resource> <directory>${project.basedir}/data</directory> <includes> <include>myDb.db</include> </includes> <filtering>false</filtering> </resource> </resources> </configuration> </execution> </executions> </plugin> 
    • I just started to understand the issues related to the assembly using maven - I understand correctly that this method connects the "plug-in" of mavena, which allows you to more parametrize the assembly more extensively? - abbath0767
    • one
      Yes. exactly. In maven, most of the necessary functionality is implemented through plug-ins, which are described in the build > plugins section. - enzo
    • I tried what you advised, but there were no changes. Maybe I misunderstood $ {project.basedir} - what should I replace this line with? - abbath0767
    • It seems I understood that this is how it should be written: "$ {project.basedir} / ...". Close the question, thank - abbath0767