Here is a sample pom.xml

When I execute it, I actually obtain this in the result.txt file :

runtimeclasspath = C:\Dev\cygwin\home\ScokartG\project\testantrun\target\classes;C:\dev\data\maven2_repository\log4j\log
4j\1.2.11\log4j-1.2.11.jar;C:\dev\data\maven2_repository\ant\ant\1.6\ant-1.6.jar;C:\dev\data\maven2_repository\velocity\
velocity\1.4\velocity-1.4.jar
compileclasspath = C:\dev\data\maven2_repository\log4j\log4j\1.2.11\log4j-1.2.11.jar;C:\dev\data\maven2_repository\ant\a
nt\1.6\ant-1.6.jar;C:\dev\data\maven2_repository\velocity\velocity\1.4\velocity-1.4.jar

The runtime classpth contains target/classes + all other jar contained in compilepath, but doesn't contains the velocity-dep jar.

_________________________________________________________________
Créez gratuitement votre espace perso en ligne avec MSN Spaces ! http://spaces.msn.com/?mkt=fr-be
<project xmlns="http://maven.apache.org/maven-v4_0_0.xsd";>

  <modelVersion>4.0.0</modelVersion>
  
  <groupId>testing</groupId>
  <artifactId>testantrun</artifactId>
  <packaging>jar</packaging>
  <version>0.1-SNAPSHOT</version>
  
  <name>TestAntRun</name>
    
  
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>
  
  
  <build>
	<sourceDirectory>src/main/java</sourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    
    
    <plugins>    
	    <plugin>
  			<artifactId>maven-antrun-plugin</artifactId>
  			<version>1.0-SNAPSHOT</version>
  			<executions>
     			<execution>
       				<phase>generate-test-sources</phase>
       				<configuration>
         				<tasks>
         					<echo file="tmp.txt">
runtimeclasspath = ${project.runtimeClasspathElements}
compileclasspath = ${project.compileClasspathElements}
</echo>
         					
         					<replace file="tmp.txt" token="[" />
         					<replace file="tmp.txt" token="]" />
         					<replace file="tmp.txt" token=", " value=";"/>
         					<replace file="tmp.txt" token="\" value="\\"/> <!-- I work under windows :-( -->
         					
         					<property file="tmp.txt" />
         					 
         					<echo file="result.txt">
runtimeclasspath = ${runtimeclasspath}
compileclasspath = ${compileclasspath}
</echo>
         					 
        					<!-- The, here is what I does to test my project 
         					<taskdef name="nextmock" classname="org.nextmock.ant.Task" classpath="${runtimeclasspath}"/>
							
        					<mkdir dir="target/test-generated/src"/>
		
							<nextmock destdir="target/test-generated/src">
								<srcfile dir="target/test-classes" includes="org/nextmock/SimpleClass.class"/>
							</nextmock>
							-->
	        			</tasks>
       				</configuration>
       				<goals>
         				<goal>run</goal>
       				</goals>
     			</execution>
   			</executions>
		</plugin>	    
	</plugins>
    
  </build>
 
  <pluginRepositories>
  	<pluginRepository>
  		<!-- used for antrun -->
  		<id>nemonics_rep</id>
  		<name>Neonics</name>
  		<url>http://www.neonics.com/maven2/</url>
  	</pluginRepository>
  </pluginRepositories>
  
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>velocity</groupId>
      <artifactId>velocity</artifactId>
      <version>1.4</version>
      <scope>compile</scope>
    </dependency>
    
    <!-- Should be set a runtime dependency of velocity -->
    <dependency>
      <groupId>velocity</groupId>
      <artifactId>velocity-dep</artifactId>
      <version>1.4</version>
      <scope>runtime</scope>
    </dependency>
    
    <dependency>
      <groupId>jmock</groupId>
      <artifactId>jmock</artifactId>
      <version>1.0.1</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>jmock</groupId>
      <artifactId>jmock-cglib</artifactId>
      <version>1.0.1</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.6</version>
      <scope>compile</scope>
    </dependency>
    
     <dependency>
      <groupId>ant</groupId>
      <artifactId>ant-launcher</artifactId>
      <version>1.6</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>ant</groupId>
      <artifactId>ant-apache-log4j</artifactId>
      <version>1.6.5</version> <!-- TODO Use 1.6, but for the moment, it doesn't exist -->
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.11</version>
      <scope>compile</scope>
    </dependency>
    
  </dependencies>
</project>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to