You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Frederic Conrotte <fr...@gmail.com> on 2008/11/11 00:46:40 UTC

How to copy dependencies of a pom packaged dependency ?

Hello Maven fans,

I'm new Maven user, just 1 month experience. I red docs and the very good
Sonatype Maven book:
http://www.sonatype.com/book/reference/public-book.html

but i'm still missing a feature or couldn't find the "Maven way" to do it.

Basically I have grouped for convenience all my Spring Framework
dependencies in a single pom-packaged artifact named
org.eclipse.ofmp.lib.springframework :

org.eclipse.ofmp.lib.springframework/pom.xml :

(...snipp...)
	<dependencies>
        <!-- Spring -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.core</artifactId>
			<version>${spring.version}</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.aop</artifactId>
			<version>${spring.version}</version>
			<exclusions>
				<exclusion>
					<groupId>aopalliance</groupId>
					<artifactId>aopalliance</artifactId>
				</exclusion>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
(...snipp...)
	</dependencies>

Then I have another project named core-runtime that simply depend on this
pom-packaged artifact:

core-runtime/pom.xml :

(...snipp...)
		<dependency>
			<groupId>org.eclipse.ofmp</groupId>
			<artifactId>org.eclipse.ofmp.lib.springframework</artifactId>
			<type>pom</type>
			<version>${spring.version}</version>
		</dependency>


No issue so far.

But now I need to copy all dependencies of core-runtime/pom.xml in a folder
called "/target/maven_plugins" in order to set those dependencies as my
Eclipse Target :

			<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/maven_plugins</outputDirectory>
							<excludeTransitive>true</excludeTransitive>
						</configuration>
					</execution>
				</executions>
			</plugin>

The problem is that in my /target/maven_plugins folder, I end up with the
org.eclipse.ofmp.lib.springframework-1.0.0.pom artifact instead of
org.eclipse.ofmp.lib.springframework-1.0.0.pom's Spring dependencies
themselves.

Does Maven provides a solution for this use case ?

Many thanks

Frederic Conrotte
-- 
View this message in context: http://www.nabble.com/How-to-copy-dependencies-of-a-pom-packaged-dependency---tp20430629p20430629.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: How to copy dependencies of a pom packaged dependency ?

Posted by Frederic Conrotte <fr...@gmail.com>.
Ok I think I posted too fast and just found it...

dependency:copy-dependencies:excludeTransitive parameter was set to true.
Setting it to false and excluding pom types does the job.

			<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/maven_plugins</outputDirectory>
							<excludeTransitive>false</excludeTransitive>
							<excludeTypes>pom</excludeTypes>
						</configuration>
					</execution>
				</executions>
			</plugin>

Fred
-- 
View this message in context: http://www.nabble.com/How-to-copy-dependencies-of-a-pom-packaged-dependency---tp20430629p20430821.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