Re: making jar with conf files
Hi Aitor, You should place all your configuration files under src/main/resources. For example: src/main/resources/myconf/myconf.properties. All files under src/main/resources will get packaged into your artifact's jar file. Furthermore, all your test resources should be placed (likewise) under src/test/resources. The resources under there won't be packaged under your final artifact and will only be used for the purpose of your tests. Kind regards, Martin On Mon, Sep 15, 2014 at 4:59 PM, Aitor Iturriondobeitia < laudio.i...@gmail.com> wrote: > hello > > i have one java maven proyecto. > into this proyect i have one dir "myconf" with the conf files > whe i make the jar install (mvn clean install) it creates the jar files > with the code but no the con files. > the structure is: > myproyecto > |-src/java/main/. > |-myconf > |-miconf.properties > |-myconf.xml > into my jar only appears the META-INF dir and the code but not the myconf > directory and the conf files. > the pom.xml file is: > 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/xsd/maven-4.0.0.xsd";> > 4.0.0 > mygroup > myid > myid > jar > 0.0.1-SNAPSHOT > myid > > ${basedir}/src/java/main > > > > > c:\config > true > > myconf/**/*.* > > > > > > org.apache.maven.plugins > maven-compiler-plugin > > 1.6 > 1.6 > Cp1252 > > > > org.apache.maven.plugins > maven-dependency-plugin > > > copy-dependencies > package > > copy-dependencies > > > > target/lib > > true > > true > > true > > > > > > org.apache.maven.plugins > maven-jar-plugin > 2.5 > > > > > com.myo.myclass > > true > lib > > > yo > anonimo > mio > > > > > > > > > > org.apache.poi > poi > 3.6 > > > org.apache.poi > poi-ooxml > 3.6 > > > log4j > log4j > 1.2.15 > > > >
Re: making jar with conf files
You shouldn't really configure a new resources folder (with an hard-coded path) for this. Just use the standard src/main/resources and put your config folder there with it's files. If you want filtering you need to configure that though, but start without that and make sure you get what you want included in the jar first. Then you can start adding the filtering option. /Anders On Mon, Sep 15, 2014 at 5:59 PM, Aitor Iturriondobeitia < laudio.i...@gmail.com> wrote: > hello > > i have one java maven proyecto. > into this proyect i have one dir "myconf" with the conf files > whe i make the jar install (mvn clean install) it creates the jar files > with the code but no the con files. > the structure is: > myproyecto > |-src/java/main/. > |-myconf > |-miconf.properties > |-myconf.xml > into my jar only appears the META-INF dir and the code but not the myconf > directory and the conf files. > the pom.xml file is: > 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/xsd/maven-4.0.0.xsd";> > 4.0.0 > mygroup > myid > myid > jar > 0.0.1-SNAPSHOT > myid > > ${basedir}/src/java/main > > > > > c:\config > true > > myconf/**/*.* > > > > > > org.apache.maven.plugins > maven-compiler-plugin > > 1.6 > 1.6 > Cp1252 > > > > org.apache.maven.plugins > maven-dependency-plugin > > > copy-dependencies > package > > copy-dependencies > > > > target/lib > > true > > true > > true > > > > > > org.apache.maven.plugins > maven-jar-plugin > 2.5 > > > > > com.myo.myclass > > true > lib > > > yo > anonimo > mio > > > > > > > > > > org.apache.poi > poi > 3.6 > > > org.apache.poi > poi-ooxml > 3.6 > > > log4j > log4j > 1.2.15 > > > >
making jar with conf files
hello i have one java maven proyecto. into this proyect i have one dir "myconf" with the conf files whe i make the jar install (mvn clean install) it creates the jar files with the code but no the con files. the structure is: myproyecto |-src/java/main/. |-myconf |-miconf.properties |-myconf.xml into my jar only appears the META-INF dir and the code but not the myconf directory and the conf files. the pom.xml file is: 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/xsd/maven-4.0.0.xsd";> 4.0.0 mygroup myid myid jar 0.0.1-SNAPSHOT myid ${basedir}/src/java/main c:\config true myconf/**/*.* org.apache.maven.plugins maven-compiler-plugin 1.6 1.6 Cp1252 org.apache.maven.plugins maven-dependency-plugin copy-dependencies package copy-dependencies target/lib true true true org.apache.maven.plugins maven-jar-plugin 2.5 com.myo.myclass true lib yo anonimo mio org.apache.poi poi 3.6 org.apache.poi poi-ooxml 3.6 log4j log4j 1.2.15