You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Aiko85 <ni...@gmail.com> on 2008/06/27 12:36:06 UTC
Include resources from other module in .jar
Hi!
Is it possible to directly include in a jar (lets call it A.jar)
class/resource files from other module (lets call it B.jar). ? What I have
is 5 jars/modules that need to have exactly the same property/xml files
inside them, so I would like to keep the resources in a separate module, in
one place, and just include them in 5 jars.
Thanks for any help,
Anne
PS. Please don't be cryptic, I'm very new to maven ;)
--
View this message in context: http://www.nabble.com/Include-resources-from-other-module-in-.jar-tp18152318p18152318.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Include resources from other module in .jar
Posted by Tomislav Stojcevich <st...@gmail.com>.
Try the remote resources plugin
http://maven.apache.org/plugins/maven-remote-resources-plugin/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Include resources from other module in .jar
Posted by Stefan Seidel <ss...@vub.de>.
You're welcome.
You need to declare the pom in which the plugin is defined ("root pom")
as <parent> in all the poms that should inherit the plugin execution. As
I posted it it works like that for Maven 2.0.8.
regards,
Stefan
Aiko85 wrote:
> Thanks Stefan :-)
>
> So far I've added the <build> part to each of the including jar's poms and
> it works. Is it possible to configure it so the plugin configuration is in
> one place ? Didn't work out when i placed it in root pom.
>
> Anne
>
>
> VUB Stefan Seidel wrote:
>> Hi,
>>
>> one option is to extract the B jar using the dependency plugin:
>> <build>
>> <plugins>
>> <plugin>
>> <artifactId>maven-dependency-plugin</artifactId>
>> <version>2.1-SNAPSHOT</version>
>> <executions>
>> <execution>
>> <id>expand common JSP fragments</id>
>> <goals>
>> <goal>unpack-dependencies</goal>
>> </goals>
>> <phase>generate-resources</phase>
>> <configuration>
>> <includeGroupIds>your.group.id</includeGroupIds>
>> <includeArtifactIds>yourArtifactId</includeArtifactIds>
>> <excludeTransitive>true</excludeTransitive>
>> <includes>**/*.xml</includes>
>>
>> <outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
>> </configuration>
>> </execution>
>> </executions>
>> </plugin>
>>
>> adapt this a bit, add a dependency to the artifact
>> your.group.id:yourArtifactId (where your shared resources are placed in
>> src/main/resources) and off you go.
>>
>> HTH,
>>
>> Stefan
>>
>> Aiko85 wrote:
>>> Hi!
>>>
>>> Is it possible to directly include in a jar (lets call it A.jar)
>>> class/resource files from other module (lets call it B.jar). ? What I
>>> have
>>> is 5 jars/modules that need to have exactly the same property/xml files
>>> inside them, so I would like to keep the resources in a separate module,
>>> in
>>> one place, and just include them in 5 jars.
>>>
>>> Thanks for any help,
>>> Anne
>>>
>>> PS. Please don't be cryptic, I'm very new to maven ;)
>>
>> --
>> best regards,
>>
>> Stefan Seidel
>> software developer
>> ________________________
>> VUB Printmedia GmbH
>> Chopinstraße 4
>> D-04103 Leipzig
>> Germany
>> tel. +49 (341) 9 60 50 07
>> fax. +49 (341) 9 60 50 92
>> mail. sseidel@vub.de
>> web. www.vub.de
>>
>> HRB Köln 24015
>> UStID DE 122 649 251
>> GF Dr. Achim Preuss Neudorf,
>> Dr. Christian Preuss Neudorf
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
--
best regards,
Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel. +49 (341) 9 60 50 07
fax. +49 (341) 9 60 50 92
mail. sseidel@vub.de
web. www.vub.de
HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Include resources from other module in .jar
Posted by Aiko85 <ni...@gmail.com>.
Thanks Stefan :-)
So far I've added the <build> part to each of the including jar's poms and
it works. Is it possible to configure it so the plugin configuration is in
one place ? Didn't work out when i placed it in root pom.
Anne
VUB Stefan Seidel wrote:
>
> Hi,
>
> one option is to extract the B jar using the dependency plugin:
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-dependency-plugin</artifactId>
> <version>2.1-SNAPSHOT</version>
> <executions>
> <execution>
> <id>expand common JSP fragments</id>
> <goals>
> <goal>unpack-dependencies</goal>
> </goals>
> <phase>generate-resources</phase>
> <configuration>
> <includeGroupIds>your.group.id</includeGroupIds>
> <includeArtifactIds>yourArtifactId</includeArtifactIds>
> <excludeTransitive>true</excludeTransitive>
> <includes>**/*.xml</includes>
>
> <outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> adapt this a bit, add a dependency to the artifact
> your.group.id:yourArtifactId (where your shared resources are placed in
> src/main/resources) and off you go.
>
> HTH,
>
> Stefan
>
> Aiko85 wrote:
>> Hi!
>>
>> Is it possible to directly include in a jar (lets call it A.jar)
>> class/resource files from other module (lets call it B.jar). ? What I
>> have
>> is 5 jars/modules that need to have exactly the same property/xml files
>> inside them, so I would like to keep the resources in a separate module,
>> in
>> one place, and just include them in 5 jars.
>>
>> Thanks for any help,
>> Anne
>>
>> PS. Please don't be cryptic, I'm very new to maven ;)
>
>
> --
> best regards,
>
> Stefan Seidel
> software developer
> ________________________
> VUB Printmedia GmbH
> Chopinstraße 4
> D-04103 Leipzig
> Germany
> tel. +49 (341) 9 60 50 07
> fax. +49 (341) 9 60 50 92
> mail. sseidel@vub.de
> web. www.vub.de
>
> HRB Köln 24015
> UStID DE 122 649 251
> GF Dr. Achim Preuss Neudorf,
> Dr. Christian Preuss Neudorf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Include-resources-from-other-module-in-.jar-tp18152318p18154011.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Include resources from other module in .jar
Posted by Stefan Seidel <ss...@vub.de>.
Hi,
one option is to extract the B jar using the dependency plugin:
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
<executions>
<execution>
<id>expand common JSP fragments</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<includeGroupIds>your.group.id</includeGroupIds>
<includeArtifactIds>yourArtifactId</includeArtifactIds>
<excludeTransitive>true</excludeTransitive>
<includes>**/*.xml</includes>
<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
adapt this a bit, add a dependency to the artifact
your.group.id:yourArtifactId (where your shared resources are placed in
src/main/resources) and off you go.
HTH,
Stefan
Aiko85 wrote:
> Hi!
>
> Is it possible to directly include in a jar (lets call it A.jar)
> class/resource files from other module (lets call it B.jar). ? What I have
> is 5 jars/modules that need to have exactly the same property/xml files
> inside them, so I would like to keep the resources in a separate module, in
> one place, and just include them in 5 jars.
>
> Thanks for any help,
> Anne
>
> PS. Please don't be cryptic, I'm very new to maven ;)
--
best regards,
Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel. +49 (341) 9 60 50 07
fax. +49 (341) 9 60 50 92
mail. sseidel@vub.de
web. www.vub.de
HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org