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 <
[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