In the resources in the profile folder there is a configuration file, depending on the profile it should be taken and put in the resource root
Actually, what I encountered
- He puts it in the project itself, and not in the original jar
- When the second time you collect this file already comes
So that the folder itself in the jar does not fall
<plugins> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>${maven-resources-plugin.version}</version> <executions> <execution> <id>copy-properties</id> <phase>package</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${basedir}/src/main/resources</outputDirectory> <resources> <resource> <directory>${basedir}/src/main/resources/profile/${profile.dir}</directory> <includes> <include>server.properties</include> </includes> </resource> </resources> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ejb-plugin</artifactId> <version>${maven-ejb-plugin.version}</version> <configuration> <filterDeploymentDescriptor>true</filterDeploymentDescriptor> <archive> <manifest> <addClasspath>true</addClasspath> </manifest> <addMavenDescriptor>false</addMavenDescriptor> </archive> <ejbVersion>3.0</ejbVersion> </configuration> </plugin> </plugins>
Tell me where I was wrong? In which plugin to configure maven-ejb-plugin or maven-resources-plugin
I have src/main/recoursces/profile/
- serverA/server.properties
- serverB/server.properties
- serverC/server.properties
I want jar - It did not have a folder profile - and have one server.properties