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

Hi Ralf,

the main feature of Tycho is to support building OSGi bundles like Eclipse Plugins with maven. The default directory structure of Eclipse Plugins is different then the dir structure of pure maven projects. If you realy want to use the default maven structure for Eclipse Plugins this might work: all java files all resource files

Content of
    source.. = src/main/java
    output.. = bin/
    bin.includes = META-INF/,\
Note that bin.includes does not include the src/main/resources but the "." directory is.
And within the pom.xml to pull in the resource files:
(And within Eclipse the classpath has to be adjusted that the src directory is under "src/main/java" to make JDT happy). 

With that setup you could not use pomless builds anymore because of the <resources> stuff in the pom. Well maybe it does if it works if you could specify that in the parent pom.


Von: tycho-user-bounces@xxxxxxxxxxx <tycho-user-bounces@xxxxxxxxxxx> im Auftrag von Ralf Heydenreich <rheydenr@xxxxxxxxxxx>
Gesendet: Montag, 25. April 2016 19:15
An: tycho-user@xxxxxxxxxxx
Betreff: 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:
>                 pom.xml
>                 src/foo/bar/
>                 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:

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?


> -----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:
> bin.includes = META-INF/,\
>                src/main/resources/
> pom.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <project xsi:schemaLocation="
> xmlns="";
>     xmlns:xsi="";>
>   <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

tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top