I need to create a simple application to configure and launch my client on my site. I use the Spring structure, so I have several configuration files that should be in the class path. I am using Maven2 with Netbeans as my IDE.
I can create and run my application using Netbeans / Maven, and I use the Application Assembler Maven plugin to create an executable application. All this works fine, except that my Spring configuration files should be placed in src / main / resources , which means they will be packed into the resulting JAR file.
I need my client to be able to modify configuration files to test them, but it is not wise to ask them to modify copies that are packaged in a JAR.
There may be a number of solutions, but it seems to me that the easiest way would be to force Maven to not pack the application and configuration files in the JAR at all, just leaving them something like classes from which they can be launched. This will allow the user to easily modify configuration files. Unfortunately, I cannot figure out how to get Maven to "package" the application this way or how to get AppAssembler to generate the resulting runnable.
Here is an excerpt from my pom.xml, which may help illustrate what I'm trying to do:
... <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>3.1.0.RELEASE</version> </dependency> ... stuff deleted ... </dependencies> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>appassembler-maven-plugin</artifactId> <version>1.2</version> <configuration> <configurationDirectory>conf</configurationDirectory> <copyConfigurationDirectory>true</copyConfigurationDirectory> <includeConfigurationDirectoryInClasspath> true </includeConfigurationDirectoryInClasspath> <platforms> <platform>windows</platform> </platforms> <programs> <program> <mainClass>org.my.path.App</mainClass> <name>app</name> </program> </programs> </configuration> </plugin> </plugins> </build> ...
source share