Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] No packaging of resources into jar

Am 25.04.2016 um 08:59 schrieb SCHREIBER.Martin:
> Hi Ralf,
>
> I recommend not to place the resources under the "src" directory. 
> The setup is much easier if you place all the resources into a "resources" folder within your project and not the src directory:
>
> Foo.bar/
>                 pom.xml
>                 src/foo/bar/MyPlugin.java
>                 resources/mypic.png
>                 resources/mytextfile.txt
>
>
> [...]

Hi Martin,
thanks for your fast answer. I'm afraid of this... I've tried to keep on
default structure for Maven projects, as described here:
https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

Ok, I've changed it and now it works pomless again. But, anyhow, is
there a possibility to keep on default structure? To copy the resources
into jar root?

Regards,
Ralf.


>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] Im Auftrag von Ralf Heydenreich
> Gesendet: Montag, 25. April 2016 01:06
> An: tycho-user@xxxxxxxxxxx
> Betreff: [tycho-user] No packaging of resources into jar
>
> Hi all,
> I've a project which contains some resources under /src/main/resources.
> Now I want to pack these resources into my jar file. But it doesn't work. The resources are copied to /classes/resources, but the resulting jar file is empty!
>
> I have the following configuration:
>
> build.properties:
> bin.includes = META-INF/,\
>                src/main/resources/
>
> pom.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";
> xmlns="http://maven.apache.org/POM/4.0.0";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>   <modelVersion>4.0.0</modelVersion>
>   <parent>
>     <groupId>com.mycompany.myapp</groupId>
>     <artifactId>MyApp-Parent</artifactId>
>     <version>2.0.0-SNAPSHOT</version>
>   </parent>
>   <artifactId>com.mycompany.myapp.resources.templates</artifactId>
>   <version>2.0.0-SNAPSHOT</version>
>   <packaging>eclipse-plugin</packaging>
>       <build>
>         <resources>
>             <resource>
>                 <directory>src/main/resources</directory>
>                 <targetPath>resources</targetPath>
>                 <!-- filtering>true</filtering -->
>                 <includes>
>                     <include>**/*</include>
>                 </includes>
>             </resource>
>         </resources>
> </build>
> </project>
>
> I've tried it with a pom-less  build, but this didn't work, too. How can I pack the resource files into the jar file?
>
> TIA,
> Ralf
>



Back to the top