You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by youhaodeyi <yo...@gmail.com> on 2008/04/18 05:34:46 UTC

How to filter test dependency?

I add maven dependency plugin in my pom see below. But it will copy the
dependencies which is in test scope. How can I filter them out?

<build>
		<plugins>
			<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>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
-- 
View this message in context: http://www.nabble.com/How-to-filter-test-dependency--tp16759890s177p16759890.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 filter test dependency?

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
There are many ways to filter the contents of what this picks up. Take a
look at the plugin docs:
http://maven.apache.org/plugins/maven-dependency-plugin.

I also wrote about using assembly and dependency plugin together and it
shows how the filtering can work:
http://www.dzone.com/links/rss/how_to_share_resources_across_projects_in
_maven.html

-----Original Message-----
From: youhaodeyi [mailto:youhaodeyi@gmail.com] 
Sent: Thursday, April 17, 2008 11:35 PM
To: users@maven.apache.org
Subject: How to filter test dependency?


I add maven dependency plugin in my pom see below. But it will copy the
dependencies which is in test scope. How can I filter them out?

<build>
		<plugins>
			<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>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
-- 
View this message in context:
http://www.nabble.com/How-to-filter-test-dependency--tp16759890s177p1675
9890.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


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


RE: How to filter test dependency?

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Copy-dependencies includes all scopes by default, specify the scope you want in the config.

-----Original Message-----
From: youhaodeyi [mailto:youhaodeyi@gmail.com] 
Sent: Saturday, April 19, 2008 6:21 AM
To: users@maven.apache.org
Subject: RE: How to filter test dependency?


It doesn't work. This is my dependency:
<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.4</version>
			<scope>test</scope>
</dependency>
I have indicated that it is in test scope. But the copy-dependencies will
include the junit-4.4.jar.


Thomas Darbois wrote:
> 
> <build>
>                 <plugins>
>                         <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>
>                                 <!-- excluding test dependencies from
> copying -->                                      
> <excludeScope>test</excludeScope>
>                                                 </configuration>
>                                         </execution>
>                                 </executions>
>                         </plugin>
>                 </plugins>
>         </build>
> 
> 
> Tomas Darbois
> Edifixio Grenoble - Projet ScorWare
> 04 76 29 89 27
> thomas.darbois@edifixio.com
> -----Message d'origine-----
> De : youhaodeyi [mailto:youhaodeyi@gmail.com]
> Envoyé : vendredi 18 avril 2008 05:35
> À : users@maven.apache.org
> Objet : How to filter test dependency?
> 
> 
> I add maven dependency plugin in my pom see below. But it will copy the
> dependencies which is in test scope. How can I filter them out?
> 
> <build>
>                 <plugins>
>                         <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>
>                                         </execution>
>                                 </executions>
>                         </plugin>
>                 </plugins>
>         </build>
> --
> View this message in context:
> http://www.nabble.com/How-to-filter-test-dependency--tp16759890s177p16759890.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
> 
> 
> ---------------------------------------------------------------------
> 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/How-to-filter-test-dependency--tp16759890s177p16781649.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 filter test dependency?

Posted by youhaodeyi <yo...@gmail.com>.
It doesn't work. This is my dependency:
<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.4</version>
			<scope>test</scope>
</dependency>
I have indicated that it is in test scope. But the copy-dependencies will
include the junit-4.4.jar.


Thomas Darbois wrote:
> 
> <build>
>                 <plugins>
>                         <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>
>                                 <!-- excluding test dependencies from
> copying -->                                      
> <excludeScope>test</excludeScope>
>                                                 </configuration>
>                                         </execution>
>                                 </executions>
>                         </plugin>
>                 </plugins>
>         </build>
> 
> 
> Tomas Darbois
> Edifixio Grenoble - Projet ScorWare
> 04 76 29 89 27
> thomas.darbois@edifixio.com
> -----Message d'origine-----
> De : youhaodeyi [mailto:youhaodeyi@gmail.com]
> Envoyé : vendredi 18 avril 2008 05:35
> À : users@maven.apache.org
> Objet : How to filter test dependency?
> 
> 
> I add maven dependency plugin in my pom see below. But it will copy the
> dependencies which is in test scope. How can I filter them out?
> 
> <build>
>                 <plugins>
>                         <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>
>                                         </execution>
>                                 </executions>
>                         </plugin>
>                 </plugins>
>         </build>
> --
> View this message in context:
> http://www.nabble.com/How-to-filter-test-dependency--tp16759890s177p16759890.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
> 
> 
> ---------------------------------------------------------------------
> 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/How-to-filter-test-dependency--tp16759890s177p16781649.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 filter test dependency?

Posted by Thomas Darbois <Th...@edifixio.com>.
<build>
                <plugins>
                        <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>
                                <!-- excluding test dependencies from copying -->                                       <excludeScope>test</excludeScope>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </build>


Tomas Darbois
Edifixio Grenoble - Projet ScorWare
04 76 29 89 27
thomas.darbois@edifixio.com
-----Message d'origine-----
De : youhaodeyi [mailto:youhaodeyi@gmail.com]
Envoyé : vendredi 18 avril 2008 05:35
À : users@maven.apache.org
Objet : How to filter test dependency?


I add maven dependency plugin in my pom see below. But it will copy the
dependencies which is in test scope. How can I filter them out?

<build>
                <plugins>
                        <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>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </build>
--
View this message in context: http://www.nabble.com/How-to-filter-test-dependency--tp16759890s177p16759890.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


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