You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gu...@tietoenator.com on 2007/10/08 15:26:47 UTC

Assembly plugin, help

Hi,

I'm using the assembly plugin and have a problem.

I'm using it in 2 steps, first I create a jar file with dependencies.
This works fine.

In the next step I want to zip the jar together with files from a
property directory. 
This works fine if I put in the full filename including version in the
assembly descriptor.
But I don't want to be dependent on a specific version.

So what can I do?

Here is the descriptor I'm using:

<?xml version="1.0" encoding="ISO-8859-1"?>
<assembly>
	<id></id>
	<formats>
		<format>zip</format>
	</formats>
	<includeBaseDirectory>false</includeBaseDirectory>
	<files>
		<file>
	
<source>src/main/resources/safe-default.properties</source>
			<destName>safe-default.properties</destName>
			<outputDirectory>/props</outputDirectory>
			<lineEnding>unix</lineEnding>
			<fileMode>0640</fileMode>
		</file>
		<file>
			<filtered>false</filtered>
	
<source>target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar</source>
			<outputDirectory></outputDirectory>
		</file>
	</files>
	<!-- 
		<moduleSets>
		<moduleSet>
		<binaries>
		<includes>
		<include>
		target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar
		</include>
		</includes>
		<outputDirectory></outputDirectory>
		</binaries>
		</moduleSet>
		</moduleSets>
	-->
</assembly>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


SV: SV: SV: Assembly plugin, help

Posted by Gu...@tietoenator.com.
Hi again,

In windows where I execute maven the files have exactly the same time stamp so I can't tell if the jar exists before. The descriptor for creating the safe-jar is before the descriptor for creating the zip file so I would assume that the jar file is created before.

Regards
Gunnar

This is part of my pom.xml
	<build>
		<plugins>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptors>
						<descriptor>
							src/main/assembly/safe-jar.xml
						</descriptor>
						<descriptor>
							src/main/assembly/bin.xml
						</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>make-safe</id>
						<phase>package</phase>
						<goals>
							<goal>attached</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

> -----Ursprungligt meddelande-----
> Från: John Casey [mailto:jdcasey@commonjava.org] 
> Skickat: den 8 oktober 2007 19:43
> Till: Maven Users List
> Ämne: Re: SV: SV: Assembly plugin, help
> 
> Hmm, that should have worked. You might need to run in debug 
> mode, and examine the operation of the assembly plugin to see 
> what's going on. I'm not sure why that file wouldn't end up 
> in the assembly, unless it doesn't exist at the time the 
> assembly is created...
> 
> -john
> 
> On Oct 8, 2007, at 1:37 PM, <Gu...@tietoenator.com> wrote:
> 
> > Hi,
> >
> > Thanks for replying but how can I do that?
> > I tried the following which don't work. I just the property file  
> > and not the jar file:
> >
> > Gunnar
> >
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <assembly>
> > 	<id>bin</id>
> > 	<formats>
> > 		<format>zip</format>
> > 	</formats>
> > 	<includeBaseDirectory>false</includeBaseDirectory>
> > 	<files>
> > 		<file>
> > 			
> <source>src/main/resources/safe-default.properties</source>
> > 			<destName>safe-default.properties</destName>
> > 			<outputDirectory>/props</outputDirectory>
> > 			<lineEnding>unix</lineEnding>
> > 			<fileMode>0640</fileMode>
> > 		</file>
> > 		<!--
> > 		<file>
> > 			<filtered>false</filtered>
> > 			<source>
> > 				
> target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar
> > 			</source>
> > 			<outputDirectory></outputDirectory>
> > 		</file>
> > 		-->
> > 	</files>
> > 	<filesets>
> > 		<fileset>
> > 			<directory>target</directory>
> > 			<outputDirectory></outputDirectory>
> > 			<includes>
> > 				<include>*-safe-jar.jar</include>
> > 			</includes>
> > 		</fileset>
> > 	</filesets>
> > 	<!--
> > 		<moduleSets>
> > 		<moduleSet>
> > 		<binaries>
> > 		<includes>
> > 		<include>
> > 		target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar
> > 		</include>
> > 		</includes>
> > 		<outputDirectory></outputDirectory>
> > 		</binaries>
> > 		</moduleSet>
> > 		</moduleSets>
> > 	-->
> > </assembly>
> >
> >> -----Ursprungligt meddelande-----
> >> Från: John Casey [mailto:jdcasey@commonjava.org]
> >> Skickat: den 8 oktober 2007 17:48
> >> Till: Maven Users List
> >> Ämne: Re: SV: Assembly plugin, help
> >>
> >> Can you use a fileSet, and specify an include pattern that
> >> will always pickup the jar-with-dependencies, but ignore the
> >> original jar?
> >> That should allow you to use a wildcard and avoid pinning
> >> things down to a certain project version.
> >>
> >> -john
> >>
> >> On Oct 8, 2007, at 11:43 AM, 
> <Gu...@tietoenator.com> wrote:
> >>
> >>> Hi,
> >>>
> >>> Thanks for the answer, but creating the jar with
> >> dependencies is not
> >>> the problem.
> >>> It is in the next step where I need to create the zip file where I
> >>> can't use wild cards to point to my newly created jar file.
> >>>
> >>> I don't use any classifiers.
> >>>
> >>> Regards
> >>> Gunnar
> >>>
> >>>
> >>>> -----Ursprungligt meddelande-----
> >>>> Från: Graham Leggett [mailto:minfrin@sharp.fm]
> >>>> Skickat: den 8 oktober 2007 15:36
> >>>> Till: Maven Users List
> >>>> Kopia: users@maven.apache.org
> >>>> Ämne: Re: Assembly plugin, help
> >>>>
> >>>> On Mon, October 8, 2007 3:26 pm, Gunnar.Bostrom@tietoenator.com
> >>>> wrote:
> >>>>
> >>>>> I'm using the assembly plugin and have a problem.
> >>>>>
> >>>>> I'm using it in 2 steps, first I create a jar file with
> >>>> dependencies.
> >>>>> This works fine.
> >>>>>
> >>>>> In the next step I want to zip the jar together with 
> files from a
> >>>>> property directory.
> >>>>> This works fine if I put in the full filename including
> >>>> version in the
> >>>>> assembly descriptor.
> >>>>> But I don't want to be dependent on a specific version.
> >>>>>
> >>>>> So what can I do?
> >>>>
> >>>> Use the default assembly for jar-with-dependencies as
> >> described here:
> >>>>
> >>>> http://maven.apache.org/plugins/maven-assembly-plugin/descript
> >>>> or-refs.html#jar-with-dependencies
> >>>>
> >>>> The dependencyset used is "any dependency resolved by your
> >> pom". You
> >>>> problem is then reduced to making sure your pom file for
> >> the assembly
> >>>> depends correctly on the right version of your artifact.
> >>>>
> >>>> The way we make sure our assembly always corresponds with the
> >>>> original artifact is to place the original artifact and
> >> the assembly
> >>>> into a multi-module build, and then use ${pom.version}
> >> everywhere we
> >>>> need the version. All the modules in the multi-module build get
> >>>> released together.
> >>>>
> >>>> One caveat: the assembly plugin doesn't like to mix multi-module
> >>>> builds and classifiers together, if you don't use classifiers it
> >>>> should "just work".
> >>>>
> >>>> Regards,
> >>>> Graham
> >>>> --
> >>>>
> >>>>
> >>>>
> >>>>
> >> 
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >> 
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>
> >> ---
> >> John Casey
> >> Committer and PMC Member, Apache Maven
> >> mail: jdcasey at commonjava dot org
> >> blog: http://www.ejlife.net/blogs/john
> >> rss: http://feeds.feedburner.com/ejlife/john
> >>
> >>
> >>
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> 
> ---
> John Casey
> Committer and PMC Member, Apache Maven
> mail: jdcasey at commonjava dot org
> blog: http://www.ejlife.net/blogs/john
> rss: http://feeds.feedburner.com/ejlife/john
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Assembly plugin, help

Posted by Gu...@tietoenator.com.
Hi again,

I've removed the generation of the jar file, so now I know that it exists when I do the zip file.

Regards
Gunnar

Here is an excerpt when running mvn with -X

[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-assembly-plugin:2.2-bet
a-1:attached' -->
[DEBUG]   (s) appendAssemblyId = true
[DEBUG]   (f) attach = true
[DEBUG]   (s) basedir = D:\SERF\dev\serf-safe
[DEBUG]   (s) descriptors = [Ljava.io.File;@12b6c89
[DEBUG]   (s) filters = []
[DEBUG]   (s) finalName = serf-safe-1.1.3-SNAPSHOT
[DEBUG]   (s) includeSite = false
[DEBUG]   (s) localRepository = [local] -> file://D:\gbx\m2\repository
[DEBUG]   (s) outputDirectory = D:\SERF\dev\serf-safe\target
[DEBUG]   (f) project = org.apache.maven.project.MavenProject@f3e6ee6b
[DEBUG]   (s) reactorProjects = [org.apache.maven.project.MavenProject@f3e6ee6b]

[DEBUG]   (f) remoteRepositories = [[external_free] -> http://sunsub.sundsvall.k
icore.net:8080/repository/external_free, [external_non_free] -> http://sunsub.su
ndsvall.kicore.net:8080/repository/external_non_free, [inhouse] -> http://sunsub
.sundsvall.kicore.net:8080/repository/inhouse, [inhouse_snapshot] -> http://suns
ub.sundsvall.kicore.net:8080/repository/inhouse_snapshot, [central] -> http://re
po1.maven.org/maven2]
[DEBUG]   (s) siteDirectory = D:\SERF\dev\serf-safe\target\site
[DEBUG]   (s) tarLongFileMode = warn
[DEBUG]   (s) tempRoot = D:\SERF\dev\serf-safe\target\archive-tmp
[DEBUG]   (s) workDirectory = D:\SERF\dev\serf-safe\target\assembly\work
[DEBUG] -- end configuration --
[INFO] [assembly:attached {execution: make-safe}]
[INFO] Reading assembly descriptor: D:\SERF\dev\serf-safe\src\main\assembly\bin.
xml
[DEBUG] No dependency sets specified.
[INFO] Building zip: D:\SERF\dev\serf-safe\target\serf-safe-1.1.3-SNAPSHOT-bin.z
ip
[DEBUG] adding directory props/
[DEBUG] adding entry props/safe-default.properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16 seconds
[INFO] Finished at: Tue Oct 09 08:38:28 CEST 2007
[INFO] Final Memory: 9M/17M
[INFO] ------------------------------------------------------------------------ 

> -----Ursprungligt meddelande-----
> Från: John Casey [mailto:jdcasey@commonjava.org] 
> Skickat: den 8 oktober 2007 19:43
> Till: Maven Users List
> Ämne: Re: SV: SV: Assembly plugin, help
> 
> Hmm, that should have worked. You might need to run in debug 
> mode, and examine the operation of the assembly plugin to see 
> what's going on. I'm not sure why that file wouldn't end up 
> in the assembly, unless it doesn't exist at the time the 
> assembly is created...
> 
> -john
> 
> On Oct 8, 2007, at 1:37 PM, <Gu...@tietoenator.com> wrote:
> 
> > Hi,
> >
> > Thanks for replying but how can I do that?
> > I tried the following which don't work. I just the property file  
> > and not the jar file:
> >
> > Gunnar
> >
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <assembly>
> > 	<id>bin</id>
> > 	<formats>
> > 		<format>zip</format>
> > 	</formats>
> > 	<includeBaseDirectory>false</includeBaseDirectory>
> > 	<files>
> > 		<file>
> > 			
> <source>src/main/resources/safe-default.properties</source>
> > 			<destName>safe-default.properties</destName>
> > 			<outputDirectory>/props</outputDirectory>
> > 			<lineEnding>unix</lineEnding>
> > 			<fileMode>0640</fileMode>
> > 		</file>
> > 		<!--
> > 		<file>
> > 			<filtered>false</filtered>
> > 			<source>
> > 				
> target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar
> > 			</source>
> > 			<outputDirectory></outputDirectory>
> > 		</file>
> > 		-->
> > 	</files>
> > 	<filesets>
> > 		<fileset>
> > 			<directory>target</directory>
> > 			<outputDirectory></outputDirectory>
> > 			<includes>
> > 				<include>*-safe-jar.jar</include>
> > 			</includes>
> > 		</fileset>
> > 	</filesets>
> > 	<!--
> > 		<moduleSets>
> > 		<moduleSet>
> > 		<binaries>
> > 		<includes>
> > 		<include>
> > 		target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar
> > 		</include>
> > 		</includes>
> > 		<outputDirectory></outputDirectory>
> > 		</binaries>
> > 		</moduleSet>
> > 		</moduleSets>
> > 	-->
> > </assembly>
> >
> >> -----Ursprungligt meddelande-----
> >> Från: John Casey [mailto:jdcasey@commonjava.org]
> >> Skickat: den 8 oktober 2007 17:48
> >> Till: Maven Users List
> >> Ämne: Re: SV: Assembly plugin, help
> >>
> >> Can you use a fileSet, and specify an include pattern that
> >> will always pickup the jar-with-dependencies, but ignore the
> >> original jar?
> >> That should allow you to use a wildcard and avoid pinning
> >> things down to a certain project version.
> >>
> >> -john
> >>
> >> On Oct 8, 2007, at 11:43 AM, 
> <Gu...@tietoenator.com> wrote:
> >>
> >>> Hi,
> >>>
> >>> Thanks for the answer, but creating the jar with
> >> dependencies is not
> >>> the problem.
> >>> It is in the next step where I need to create the zip file where I
> >>> can't use wild cards to point to my newly created jar file.
> >>>
> >>> I don't use any classifiers.
> >>>
> >>> Regards
> >>> Gunnar
> >>>
> >>>
> >>>> -----Ursprungligt meddelande-----
> >>>> Från: Graham Leggett [mailto:minfrin@sharp.fm]
> >>>> Skickat: den 8 oktober 2007 15:36
> >>>> Till: Maven Users List
> >>>> Kopia: users@maven.apache.org
> >>>> Ämne: Re: Assembly plugin, help
> >>>>
> >>>> On Mon, October 8, 2007 3:26 pm, Gunnar.Bostrom@tietoenator.com
> >>>> wrote:
> >>>>
> >>>>> I'm using the assembly plugin and have a problem.
> >>>>>
> >>>>> I'm using it in 2 steps, first I create a jar file with
> >>>> dependencies.
> >>>>> This works fine.
> >>>>>
> >>>>> In the next step I want to zip the jar together with 
> files from a
> >>>>> property directory.
> >>>>> This works fine if I put in the full filename including
> >>>> version in the
> >>>>> assembly descriptor.
> >>>>> But I don't want to be dependent on a specific version.
> >>>>>
> >>>>> So what can I do?
> >>>>
> >>>> Use the default assembly for jar-with-dependencies as
> >> described here:
> >>>>
> >>>> http://maven.apache.org/plugins/maven-assembly-plugin/descript
> >>>> or-refs.html#jar-with-dependencies
> >>>>
> >>>> The dependencyset used is "any dependency resolved by your
> >> pom". You
> >>>> problem is then reduced to making sure your pom file for
> >> the assembly
> >>>> depends correctly on the right version of your artifact.
> >>>>
> >>>> The way we make sure our assembly always corresponds with the
> >>>> original artifact is to place the original artifact and
> >> the assembly
> >>>> into a multi-module build, and then use ${pom.version}
> >> everywhere we
> >>>> need the version. All the modules in the multi-module build get
> >>>> released together.
> >>>>
> >>>> One caveat: the assembly plugin doesn't like to mix multi-module
> >>>> builds and classifiers together, if you don't use classifiers it
> >>>> should "just work".
> >>>>
> >>>> Regards,
> >>>> Graham
> >>>> --
> >>>>
> >>>>
> >>>>
> >>>>
> >> 
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >> 
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>
> >> ---
> >> John Casey
> >> Committer and PMC Member, Apache Maven
> >> mail: jdcasey at commonjava dot org
> >> blog: http://www.ejlife.net/blogs/john
> >> rss: http://feeds.feedburner.com/ejlife/john
> >>
> >>
> >>
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> 
> ---
> John Casey
> Committer and PMC Member, Apache Maven
> mail: jdcasey at commonjava dot org
> blog: http://www.ejlife.net/blogs/john
> rss: http://feeds.feedburner.com/ejlife/john
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: SV: SV: Assembly plugin, help

Posted by John Casey <jd...@commonjava.org>.
Hmm, that should have worked. You might need to run in debug mode,  
and examine the operation of the assembly plugin to see what's going  
on. I'm not sure why that file wouldn't end up in the assembly,  
unless it doesn't exist at the time the assembly is created...

-john

On Oct 8, 2007, at 1:37 PM, <Gu...@tietoenator.com> wrote:

> Hi,
>
> Thanks for replying but how can I do that?
> I tried the following which don't work. I just the property file  
> and not the jar file:
>
> Gunnar
>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <assembly>
> 	<id>bin</id>
> 	<formats>
> 		<format>zip</format>
> 	</formats>
> 	<includeBaseDirectory>false</includeBaseDirectory>
> 	<files>
> 		<file>
> 			<source>src/main/resources/safe-default.properties</source>
> 			<destName>safe-default.properties</destName>
> 			<outputDirectory>/props</outputDirectory>
> 			<lineEnding>unix</lineEnding>
> 			<fileMode>0640</fileMode>
> 		</file>
> 		<!--
> 		<file>
> 			<filtered>false</filtered>
> 			<source>
> 				target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar
> 			</source>
> 			<outputDirectory></outputDirectory>
> 		</file>
> 		-->
> 	</files>
> 	<filesets>
> 		<fileset>
> 			<directory>target</directory>
> 			<outputDirectory></outputDirectory>
> 			<includes>
> 				<include>*-safe-jar.jar</include>
> 			</includes>
> 		</fileset>
> 	</filesets>
> 	<!--
> 		<moduleSets>
> 		<moduleSet>
> 		<binaries>
> 		<includes>
> 		<include>
> 		target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar
> 		</include>
> 		</includes>
> 		<outputDirectory></outputDirectory>
> 		</binaries>
> 		</moduleSet>
> 		</moduleSets>
> 	-->
> </assembly>
>
>> -----Ursprungligt meddelande-----
>> Från: John Casey [mailto:jdcasey@commonjava.org]
>> Skickat: den 8 oktober 2007 17:48
>> Till: Maven Users List
>> Ämne: Re: SV: Assembly plugin, help
>>
>> Can you use a fileSet, and specify an include pattern that
>> will always pickup the jar-with-dependencies, but ignore the
>> original jar?
>> That should allow you to use a wildcard and avoid pinning
>> things down to a certain project version.
>>
>> -john
>>
>> On Oct 8, 2007, at 11:43 AM, <Gu...@tietoenator.com> wrote:
>>
>>> Hi,
>>>
>>> Thanks for the answer, but creating the jar with
>> dependencies is not
>>> the problem.
>>> It is in the next step where I need to create the zip file where I
>>> can't use wild cards to point to my newly created jar file.
>>>
>>> I don't use any classifiers.
>>>
>>> Regards
>>> Gunnar
>>>
>>>
>>>> -----Ursprungligt meddelande-----
>>>> Från: Graham Leggett [mailto:minfrin@sharp.fm]
>>>> Skickat: den 8 oktober 2007 15:36
>>>> Till: Maven Users List
>>>> Kopia: users@maven.apache.org
>>>> Ämne: Re: Assembly plugin, help
>>>>
>>>> On Mon, October 8, 2007 3:26 pm, Gunnar.Bostrom@tietoenator.com
>>>> wrote:
>>>>
>>>>> I'm using the assembly plugin and have a problem.
>>>>>
>>>>> I'm using it in 2 steps, first I create a jar file with
>>>> dependencies.
>>>>> This works fine.
>>>>>
>>>>> In the next step I want to zip the jar together with files from a
>>>>> property directory.
>>>>> This works fine if I put in the full filename including
>>>> version in the
>>>>> assembly descriptor.
>>>>> But I don't want to be dependent on a specific version.
>>>>>
>>>>> So what can I do?
>>>>
>>>> Use the default assembly for jar-with-dependencies as
>> described here:
>>>>
>>>> http://maven.apache.org/plugins/maven-assembly-plugin/descript
>>>> or-refs.html#jar-with-dependencies
>>>>
>>>> The dependencyset used is "any dependency resolved by your
>> pom". You
>>>> problem is then reduced to making sure your pom file for
>> the assembly
>>>> depends correctly on the right version of your artifact.
>>>>
>>>> The way we make sure our assembly always corresponds with the
>>>> original artifact is to place the original artifact and
>> the assembly
>>>> into a multi-module build, and then use ${pom.version}
>> everywhere we
>>>> need the version. All the modules in the multi-module build get
>>>> released together.
>>>>
>>>> One caveat: the assembly plugin doesn't like to mix multi-module
>>>> builds and classifiers together, if you don't use classifiers it
>>>> should "just work".
>>>>
>>>> Regards,
>>>> Graham
>>>> --
>>>>
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> ---
>> John Casey
>> Committer and PMC Member, Apache Maven
>> mail: jdcasey at commonjava dot org
>> blog: http://www.ejlife.net/blogs/john
>> rss: http://feeds.feedburner.com/ejlife/john
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john
rss: http://feeds.feedburner.com/ejlife/john



SV: SV: Assembly plugin, help

Posted by Gu...@tietoenator.com.
Hi,

Thanks for replying but how can I do that?
I tried the following which don't work. I just the property file and not the jar file:

Gunnar


<?xml version="1.0" encoding="ISO-8859-1"?>
<assembly>
	<id>bin</id>
	<formats>
		<format>zip</format>
	</formats>
	<includeBaseDirectory>false</includeBaseDirectory>
	<files>
		<file>
			<source>src/main/resources/safe-default.properties</source>
			<destName>safe-default.properties</destName>
			<outputDirectory>/props</outputDirectory>
			<lineEnding>unix</lineEnding>
			<fileMode>0640</fileMode>
		</file>
		<!-- 
		<file>
			<filtered>false</filtered>
			<source>
				target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar
			</source>
			<outputDirectory></outputDirectory>
		</file>
		-->
	</files>
	<filesets>
		<fileset>
			<directory>target</directory>
			<outputDirectory></outputDirectory>
			<includes>
				<include>*-safe-jar.jar</include>
			</includes>
		</fileset>
	</filesets>
	<!-- 
		<moduleSets>
		<moduleSet>
		<binaries>
		<includes>
		<include>
		target/serf-safe-1.1.3-SNAPSHOT-safe-jar.jar
		</include>
		</includes>
		<outputDirectory></outputDirectory>
		</binaries>
		</moduleSet>
		</moduleSets>
	-->
</assembly> 

> -----Ursprungligt meddelande-----
> Från: John Casey [mailto:jdcasey@commonjava.org] 
> Skickat: den 8 oktober 2007 17:48
> Till: Maven Users List
> Ämne: Re: SV: Assembly plugin, help
> 
> Can you use a fileSet, and specify an include pattern that 
> will always pickup the jar-with-dependencies, but ignore the 
> original jar?  
> That should allow you to use a wildcard and avoid pinning 
> things down to a certain project version.
> 
> -john
> 
> On Oct 8, 2007, at 11:43 AM, <Gu...@tietoenator.com> wrote:
> 
> > Hi,
> >
> > Thanks for the answer, but creating the jar with 
> dependencies is not 
> > the problem.
> > It is in the next step where I need to create the zip file where I 
> > can't use wild cards to point to my newly created jar file.
> >
> > I don't use any classifiers.
> >
> > Regards
> > Gunnar
> >
> >
> >> -----Ursprungligt meddelande-----
> >> Från: Graham Leggett [mailto:minfrin@sharp.fm]
> >> Skickat: den 8 oktober 2007 15:36
> >> Till: Maven Users List
> >> Kopia: users@maven.apache.org
> >> Ämne: Re: Assembly plugin, help
> >>
> >> On Mon, October 8, 2007 3:26 pm, Gunnar.Bostrom@tietoenator.com
> >> wrote:
> >>
> >>> I'm using the assembly plugin and have a problem.
> >>>
> >>> I'm using it in 2 steps, first I create a jar file with
> >> dependencies.
> >>> This works fine.
> >>>
> >>> In the next step I want to zip the jar together with files from a 
> >>> property directory.
> >>> This works fine if I put in the full filename including
> >> version in the
> >>> assembly descriptor.
> >>> But I don't want to be dependent on a specific version.
> >>>
> >>> So what can I do?
> >>
> >> Use the default assembly for jar-with-dependencies as 
> described here:
> >>
> >> http://maven.apache.org/plugins/maven-assembly-plugin/descript
> >> or-refs.html#jar-with-dependencies
> >>
> >> The dependencyset used is "any dependency resolved by your 
> pom". You 
> >> problem is then reduced to making sure your pom file for 
> the assembly 
> >> depends correctly on the right version of your artifact.
> >>
> >> The way we make sure our assembly always corresponds with the 
> >> original artifact is to place the original artifact and 
> the assembly 
> >> into a multi-module build, and then use ${pom.version} 
> everywhere we 
> >> need the version. All the modules in the multi-module build get 
> >> released together.
> >>
> >> One caveat: the assembly plugin doesn't like to mix multi-module 
> >> builds and classifiers together, if you don't use classifiers it 
> >> should "just work".
> >>
> >> Regards,
> >> Graham
> >> --
> >>
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> 
> ---
> John Casey
> Committer and PMC Member, Apache Maven
> mail: jdcasey at commonjava dot org
> blog: http://www.ejlife.net/blogs/john
> rss: http://feeds.feedburner.com/ejlife/john
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: SV: Assembly plugin, help

Posted by John Casey <jd...@commonjava.org>.
Can you use a fileSet, and specify an include pattern that will  
always pickup the jar-with-dependencies, but ignore the original jar?  
That should allow you to use a wildcard and avoid pinning things down  
to a certain project version.

-john

On Oct 8, 2007, at 11:43 AM, <Gu...@tietoenator.com> wrote:

> Hi,
>
> Thanks for the answer, but creating the jar with dependencies is  
> not the problem.
> It is in the next step where I need to create the zip file where I  
> can't use wild cards to point to my newly created jar file.
>
> I don't use any classifiers.
>
> Regards
> Gunnar
>
>
>> -----Ursprungligt meddelande-----
>> Från: Graham Leggett [mailto:minfrin@sharp.fm]
>> Skickat: den 8 oktober 2007 15:36
>> Till: Maven Users List
>> Kopia: users@maven.apache.org
>> Ämne: Re: Assembly plugin, help
>>
>> On Mon, October 8, 2007 3:26 pm, Gunnar.Bostrom@tietoenator.com  
>> wrote:
>>
>>> I'm using the assembly plugin and have a problem.
>>>
>>> I'm using it in 2 steps, first I create a jar file with
>> dependencies.
>>> This works fine.
>>>
>>> In the next step I want to zip the jar together with files from a
>>> property directory.
>>> This works fine if I put in the full filename including
>> version in the
>>> assembly descriptor.
>>> But I don't want to be dependent on a specific version.
>>>
>>> So what can I do?
>>
>> Use the default assembly for jar-with-dependencies as described here:
>>
>> http://maven.apache.org/plugins/maven-assembly-plugin/descript
>> or-refs.html#jar-with-dependencies
>>
>> The dependencyset used is "any dependency resolved by your
>> pom". You problem is then reduced to making sure your pom
>> file for the assembly depends correctly on the right version
>> of your artifact.
>>
>> The way we make sure our assembly always corresponds with the
>> original artifact is to place the original artifact and the
>> assembly into a multi-module build, and then use
>> ${pom.version} everywhere we need the version. All the
>> modules in the multi-module build get released together.
>>
>> One caveat: the assembly plugin doesn't like to mix
>> multi-module builds and classifiers together, if you don't
>> use classifiers it should "just work".
>>
>> Regards,
>> Graham
>> --
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john
rss: http://feeds.feedburner.com/ejlife/john



SV: Assembly plugin, help

Posted by Gu...@tietoenator.com.
Hi,

Thanks for the answer, but creating the jar with dependencies is not the problem.
It is in the next step where I need to create the zip file where I can't use wild cards to point to my newly created jar file.

I don't use any classifiers.

Regards
Gunnar


> -----Ursprungligt meddelande-----
> Från: Graham Leggett [mailto:minfrin@sharp.fm] 
> Skickat: den 8 oktober 2007 15:36
> Till: Maven Users List
> Kopia: users@maven.apache.org
> Ämne: Re: Assembly plugin, help
> 
> On Mon, October 8, 2007 3:26 pm, Gunnar.Bostrom@tietoenator.com wrote:
> 
> > I'm using the assembly plugin and have a problem.
> >
> > I'm using it in 2 steps, first I create a jar file with 
> dependencies.
> > This works fine.
> >
> > In the next step I want to zip the jar together with files from a 
> > property directory.
> > This works fine if I put in the full filename including 
> version in the 
> > assembly descriptor.
> > But I don't want to be dependent on a specific version.
> >
> > So what can I do?
> 
> Use the default assembly for jar-with-dependencies as described here:
> 
> http://maven.apache.org/plugins/maven-assembly-plugin/descript
> or-refs.html#jar-with-dependencies
> 
> The dependencyset used is "any dependency resolved by your 
> pom". You problem is then reduced to making sure your pom 
> file for the assembly depends correctly on the right version 
> of your artifact.
> 
> The way we make sure our assembly always corresponds with the 
> original artifact is to place the original artifact and the 
> assembly into a multi-module build, and then use 
> ${pom.version} everywhere we need the version. All the 
> modules in the multi-module build get released together.
> 
> One caveat: the assembly plugin doesn't like to mix 
> multi-module builds and classifiers together, if you don't 
> use classifiers it should "just work".
> 
> Regards,
> Graham
> --
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Assembly plugin, help

Posted by Graham Leggett <mi...@sharp.fm>.
On Mon, October 8, 2007 3:26 pm, Gunnar.Bostrom@tietoenator.com wrote:

> I'm using the assembly plugin and have a problem.
>
> I'm using it in 2 steps, first I create a jar file with dependencies.
> This works fine.
>
> In the next step I want to zip the jar together with files from a
> property directory.
> This works fine if I put in the full filename including version in the
> assembly descriptor.
> But I don't want to be dependent on a specific version.
>
> So what can I do?

Use the default assembly for jar-with-dependencies as described here:

http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies

The dependencyset used is "any dependency resolved by your pom". You
problem is then reduced to making sure your pom file for the assembly
depends correctly on the right version of your artifact.

The way we make sure our assembly always corresponds with the original
artifact is to place the original artifact and the assembly into a
multi-module build, and then use ${pom.version} everywhere we need the
version. All the modules in the multi-module build get released together.

One caveat: the assembly plugin doesn't like to mix multi-module builds
and classifiers together, if you don't use classifiers it should "just
work".

Regards,
Graham
--



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org