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/10/22 16:08:07 UTC

How to set jar and test-jar separately?

I use maven-jar-plugin like below. In this case, the test jar and jar will
have the same configuration. How can I set them separately?

<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.2</version>
				<inherited>false</inherited>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>test-jar</goal>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<outputDirectory>target/</outputDirectory>
					<excludes>
						<exclude>**/*.properties</exclude>
						<exclude>**/images/**</exclude>
						<exclude>**/protocols/**</exclude>
						<exclude>**/report/**</exclude>
					</excludes>

					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<mainClass>ui.Starter</mainClass>
							<packageName>UI DEMO</packageName>
						</manifest>
						<manifestEntries>
							<mode>development</mode>
						</manifestEntries>
						
					</archive>
				</configuration>
			</plugin>
-- 
View this message in context: http://www.nabble.com/How-to-set-jar-and-test-jar-separately--tp20111475p20111475.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 set jar and test-jar separately?

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Yes but you didn't change the configuration in the second execution so
it's probably going to be the same as the first. IIRC, there are issues
where the config isn't reset to a clean one in a second execution. So
the best bet is to first run the one closest to default, and then you
need to reset the defaults and change whatever else you want.

-----Original Message-----
From: youhaodeyi [mailto:youhaodeyi@gmail.com] 
Sent: Wednesday, October 22, 2008 10:51 AM
To: users@maven.apache.org
Subject: RE: How to set jar and test-jar separately?


Do you mean this configuration see below? The configuration setting
doesn't
work in this case.

<plugin>
	
<groupId>org.apache.maven.plugins</groupId>
	
<artifactId>maven-jar-plugin</artifactId>
				<version>2.2</version>
				<inherited>false</inherited>
				<executions>
					<execution>
						<id>jar</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
	
<outputDirectory>target/</outputDirectory>
							<excludes>
	
<exclude>src/main/resources/i18n/*.properties</exclude>
	
<exclude>src/main/resources/images/**</exclude>
	
<exclude>src/main/resources/**/protocols/**</exclude>
	
<exclude>src/main/resources/../report/**</exclude>
							</excludes>

							<archive>
	
<manifest>
	
<addClasspath>true</addClasspath>
	
<mainClass>com.ge.med.mict.ll.ui.Starter</mainClass>
	
<packageName>UI DEMO</packageName>
	
</manifest>
	
<manifestEntries>
	
<mode>development</mode>
	
</manifestEntries>
							</archive>
						</configuration>
					</execution>

					<execution>
						<id>test</id>
						<phase>package</phase>
						<goals>
	
<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>


Brian E Fox wrote:
> 
> Put them in separate executions.
> 
> -----Original Message-----
> From: youhaodeyi [mailto:youhaodeyi@gmail.com] 
> Sent: Wednesday, October 22, 2008 10:08 AM
> To: users@maven.apache.org
> Subject: How to set jar and test-jar separately?
> 
> 
> I use maven-jar-plugin like below. In this case, the test jar and jar
> will
> have the same configuration. How can I set them separately?
> 
> <plugin>
> 	
> <groupId>org.apache.maven.plugins</groupId>
> 	
> <artifactId>maven-jar-plugin</artifactId>
> 				<version>2.2</version>
> 				<inherited>false</inherited>
> 				<executions>
> 					<execution>
> 						<phase>package</phase>
> 						<goals>
> 	
> <goal>test-jar</goal>
> 							<goal>jar</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 				<configuration>
> 	
> <outputDirectory>target/</outputDirectory>
> 					<excludes>
> 	
> <exclude>**/*.properties</exclude>
> 	
> <exclude>**/images/**</exclude>
> 	
> <exclude>**/protocols/**</exclude>
> 	
> <exclude>**/report/**</exclude>
> 					</excludes>
> 
> 					<archive>
> 						<manifest>
> 	
> <addClasspath>true</addClasspath>
> 	
> <mainClass>ui.Starter</mainClass>
> 							<packageName>UI
> DEMO</packageName>
> 						</manifest>
> 						<manifestEntries>
> 	
> <mode>development</mode>
> 						</manifestEntries>
> 						
> 					</archive>
> 				</configuration>
> 			</plugin>
> -- 
> View this message in context:
>
http://www.nabble.com/How-to-set-jar-and-test-jar-separately--tp20111475
> p20111475.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-set-jar-and-test-jar-separately--tp20111475
p20112387.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 set jar and test-jar separately?

Posted by youhaodeyi <yo...@gmail.com>.
Do you mean this configuration see below? The configuration setting doesn't
work in this case.

<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.2</version>
				<inherited>false</inherited>
				<executions>
					<execution>
						<id>jar</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<outputDirectory>target/</outputDirectory>
							<excludes>
								<exclude>src/main/resources/i18n/*.properties</exclude>
								<exclude>src/main/resources/images/**</exclude>
								<exclude>src/main/resources/**/protocols/**</exclude>
								<exclude>src/main/resources/../report/**</exclude>
							</excludes>

							<archive>
								<manifest>
									<addClasspath>true</addClasspath>
									<mainClass>com.ge.med.mict.ll.ui.Starter</mainClass>
									<packageName>UI DEMO</packageName>
								</manifest>
								<manifestEntries>
									<mode>development</mode>
								</manifestEntries>
							</archive>
						</configuration>
					</execution>

					<execution>
						<id>test</id>
						<phase>package</phase>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>


Brian E Fox wrote:
> 
> Put them in separate executions.
> 
> -----Original Message-----
> From: youhaodeyi [mailto:youhaodeyi@gmail.com] 
> Sent: Wednesday, October 22, 2008 10:08 AM
> To: users@maven.apache.org
> Subject: How to set jar and test-jar separately?
> 
> 
> I use maven-jar-plugin like below. In this case, the test jar and jar
> will
> have the same configuration. How can I set them separately?
> 
> <plugin>
> 	
> <groupId>org.apache.maven.plugins</groupId>
> 	
> <artifactId>maven-jar-plugin</artifactId>
> 				<version>2.2</version>
> 				<inherited>false</inherited>
> 				<executions>
> 					<execution>
> 						<phase>package</phase>
> 						<goals>
> 	
> <goal>test-jar</goal>
> 							<goal>jar</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 				<configuration>
> 	
> <outputDirectory>target/</outputDirectory>
> 					<excludes>
> 	
> <exclude>**/*.properties</exclude>
> 	
> <exclude>**/images/**</exclude>
> 	
> <exclude>**/protocols/**</exclude>
> 	
> <exclude>**/report/**</exclude>
> 					</excludes>
> 
> 					<archive>
> 						<manifest>
> 	
> <addClasspath>true</addClasspath>
> 	
> <mainClass>ui.Starter</mainClass>
> 							<packageName>UI
> DEMO</packageName>
> 						</manifest>
> 						<manifestEntries>
> 	
> <mode>development</mode>
> 						</manifestEntries>
> 						
> 					</archive>
> 				</configuration>
> 			</plugin>
> -- 
> View this message in context:
> http://www.nabble.com/How-to-set-jar-and-test-jar-separately--tp20111475
> p20111475.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-set-jar-and-test-jar-separately--tp20111475p20112387.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 set jar and test-jar separately?

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Put them in separate executions.

-----Original Message-----
From: youhaodeyi [mailto:youhaodeyi@gmail.com] 
Sent: Wednesday, October 22, 2008 10:08 AM
To: users@maven.apache.org
Subject: How to set jar and test-jar separately?


I use maven-jar-plugin like below. In this case, the test jar and jar
will
have the same configuration. How can I set them separately?

<plugin>
	
<groupId>org.apache.maven.plugins</groupId>
	
<artifactId>maven-jar-plugin</artifactId>
				<version>2.2</version>
				<inherited>false</inherited>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
	
<goal>test-jar</goal>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
	
<outputDirectory>target/</outputDirectory>
					<excludes>
	
<exclude>**/*.properties</exclude>
	
<exclude>**/images/**</exclude>
	
<exclude>**/protocols/**</exclude>
	
<exclude>**/report/**</exclude>
					</excludes>

					<archive>
						<manifest>
	
<addClasspath>true</addClasspath>
	
<mainClass>ui.Starter</mainClass>
							<packageName>UI
DEMO</packageName>
						</manifest>
						<manifestEntries>
	
<mode>development</mode>
						</manifestEntries>
						
					</archive>
				</configuration>
			</plugin>
-- 
View this message in context:
http://www.nabble.com/How-to-set-jar-and-test-jar-separately--tp20111475
p20111475.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