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 <
[email protected]> 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:
> <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/xsd/maven-4.0.0.xsd";>
> <modelVersion>4.0.0</modelVersion>
> <groupId>mygroup</groupId>
> <artifactId>myid</artifactId>
> <name>myid</name>
> <packaging>jar</packaging>
> <version>0.0.1-SNAPSHOT</version>
> <description>myid</description>
> <build>
> <sourceDirectory>${basedir}/src/java/main</sourceDirectory>
> <filters>
> </filters>
> <resources>
> <resource>
> <directory>c:\config</directory>
> <filtering>true</filtering>
> <includes>
> <include>myconf/**/*.*</include>
> </includes>
> </resource>
> </resources>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> <encoding>Cp1252</encoding>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-dependency-plugin</artifactId>
> <executions>
> <execution>
> <id>copy-dependencies</id>
> <phase>package</phase>
> <goals>
> <goal>copy-dependencies</goal>
> </goals>
> <configuration>
> <outputDirectory>
> target/lib
> </outputDirectory>
> <overWriteReleases>true</overWriteReleases>
> <overWriteSnapshots>
> true
> </overWriteSnapshots>
> <overWriteIfNewer>true</overWriteIfNewer>
> </configuration>
> </execution>
> </executions>
> </plugin>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <version>2.5</version>
> <configuration>
> <archive>
> <manifest>
> <mainClass>
> com.myo.myclass
> </mainClass>
> <addClasspath>true</addClasspath>
> <classpathPrefix>lib</classpathPrefix>
> </manifest>
> <manifestEntries>
> <Autor>yo</Autor>
> <Empresa>anonimo</Empresa>
> <Built-By>mio</Built-By>
> </manifestEntries>
> </archive>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> <dependencies>
> <dependency>
> <groupId>org.apache.poi</groupId>
> <artifactId>poi</artifactId>
> <version>3.6</version>
> </dependency>
> <dependency>
> <groupId>org.apache.poi</groupId>
> <artifactId>poi-ooxml</artifactId>
> <version>3.6</version>
> </dependency>
> <dependency>
> <groupId>log4j</groupId>
> <artifactId>log4j</artifactId>
> <version>1.2.15</version>
> </dependency>
> </dependencies>
> </project>
>

Reply via email to