jvanzyl     2004/03/18 20:11:11

  Modified:    maven-plugins/maven-compiler-plugin project.xml
               
maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin
                        CompilerPlugin.java
               maven-plugins/maven-compiler-plugin/src/main/resources/META-INF/maven
                        plugin.xml
               maven-plugins/maven-hello-plugin/src/main/resources/META-INF/maven
                        plugin.xml
               maven-plugins/maven-jar-plugin/src/main/resources/META-INF/maven
                        plugin.xml
               maven-plugins/maven-resources-plugin/src/main/resources/META-INF/maven
                        plugin.xml
               maven-plugins/maven-scm-plugin/src/main/resources/META-INF/maven
                        plugin.xml
               maven-plugins/maven-surefire-plugin project.xml
               maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test
                        SurefirePlugin.java
               maven-plugins/maven-surefire-plugin/src/main/resources/META-INF/maven
                        plugin.xml
  Log:
  o update the plugin descriptors for changes made in maven to support 4
    flavours of POJOs people might try to integrate into Maven.
  
    CompilerPlugin is now an "integrated" plugin where any amount of
    arbitrary information can go into the execution and come out. In this
    case the compiler plugin can send back detailed compilation errors for
    use in something like and IDE.
  
  Revision  Changes    Path
  1.2       +5 -0      maven-components/maven-plugins/maven-compiler-plugin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-compiler-plugin/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml       15 Mar 2004 19:32:21 -0000      1.1
  +++ project.xml       19 Mar 2004 04:11:11 -0000      1.2
  @@ -53,6 +53,11 @@
         <artifactId>plexus-compiler</artifactId>
         <version>1.0-SNAPSHOT</version>
       </dependency>
  +    <dependency>
  +      <groupId>maven</groupId>
  +      <artifactId>maven-core</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
     </dependencies>
   
     <build>
  
  
  
  1.2       +13 -12    
maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerPlugin.java
  
  Index: CompilerPlugin.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerPlugin.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CompilerPlugin.java       15 Mar 2004 19:32:22 -0000      1.1
  +++ CompilerPlugin.java       19 Mar 2004 04:11:11 -0000      1.2
  @@ -3,10 +3,10 @@
   import org.codehaus.plexus.compiler.Compiler;
   import org.codehaus.plexus.compiler.CompilerError;
   
  +import java.io.File;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  -import java.util.Iterator;
  -import java.io.File;
   
   /**
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
  @@ -22,28 +22,29 @@
   // How to accurately report failures to users
   
   public class CompilerPlugin
  +    extends AbstractPlugin
   {
       private Map compilers;
   
  -    private String sourceDirectory;
  +    private boolean debug = true;
   
  -    private String outputDirectory;
  +    public void execute( PluginExecutionRequest request, PluginExecutionResponse 
response )
  +        throws Exception
  +    {
  +        String sourceDirectory = (String) request.getParameter( "sourceDirectory" );
   
  -    private String[] classpathElements;
  +        String outputDirectory = (String) request.getParameter( "outputDirectory" );
   
  -    private String compiler;
  +        String[] classpathElements = (String[]) request.getParameter( 
"classpathElements" );
   
  -    private boolean debug = true;
  +        String compilerId = (String) request.getParameter( "compiler" );
   
  -    public void execute()
  -        throws Exception
  -    {
           if ( ! new File( sourceDirectory ).exists() )
           {
               throw new Exception( "The specified source directory '"+ 
sourceDirectory + "' does not exist!" );
           }
   
  -        Compiler compiler = (Compiler) compilers.get( this.compiler );
  +        Compiler compiler = (Compiler) compilers.get( compilerId );
   
           List messages = compiler.compile( classpathElements, new 
String[]{sourceDirectory}, outputDirectory );
   
  
  
  
  1.3       +5 -5      
maven-components/maven-plugins/maven-compiler-plugin/src/main/resources/META-INF/maven/plugin.xml
  
  Index: plugin.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-compiler-plugin/src/main/resources/META-INF/maven/plugin.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.xml        17 Mar 2004 21:33:14 -0000      1.2
  +++ plugin.xml        19 Mar 2004 04:11:11 -0000      1.3
  @@ -1,7 +1,7 @@
   <plugin>
     <id>compiler</id>
     <implementation>org.apache.maven.plugin.CompilerPlugin</implementation>
  -  <instantiation-strategy>per-lookup</instantiation-strategy>
  +  <mode>integrated</mode>
     <requirements>
       <requirement>
         <role>org.codehaus.plexus.compiler.Compiler</role>
  @@ -11,24 +11,24 @@
     <goals>
       <goal>
         <name>compile</name>
  -      <configuration>
  +      <parameters>
           <sourceDirectory>#project.build.sourceDirectory</sourceDirectory>
           <outputDirectory>#maven.build.dest</outputDirectory>
           <classpathElements>#project.classpathElements</classpathElements>
           <compiler>javac</compiler>
  -      </configuration>
  +      </parameters>
       </goal>
       <goal>
         <name>test:compile</name>
         <prereqs>
           <prereq>compile</prereq>
         </prereqs>
  -      <configuration>
  +      <parameters>
           <sourceDirectory>#project.build.unitTestSourceDirectory</sourceDirectory>
           <outputDirectory>#maven.test.dest</outputDirectory>
           <classpathElements>#project.classpathElements</classpathElements>
           <compiler>javac</compiler>
  -      </configuration>
  +      </parameters>
       </goal>
     </goals>
   </plugin>
  
  
  
  1.2       +1 -2      
maven-components/maven-plugins/maven-hello-plugin/src/main/resources/META-INF/maven/plugin.xml
  
  Index: plugin.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-hello-plugin/src/main/resources/META-INF/maven/plugin.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- plugin.xml        15 Mar 2004 19:32:24 -0000      1.1
  +++ plugin.xml        19 Mar 2004 04:11:11 -0000      1.2
  @@ -1,11 +1,10 @@
   <plugin>
     <id>helloworld</id>
     <implementation>org.apache.maven.plugin.HelloWorldPlugin</implementation>
  +  <mode>field</mode>
     <goals>
       <goal>
         <name>hello</name>
  -      <configuration>
  -      </configuration>
       </goal>
     </goals>
   </plugin>
  
  
  
  1.2       +3 -2      
maven-components/maven-plugins/maven-jar-plugin/src/main/resources/META-INF/maven/plugin.xml
  
  Index: plugin.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-jar-plugin/src/main/resources/META-INF/maven/plugin.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- plugin.xml        15 Mar 2004 19:32:22 -0000      1.1
  +++ plugin.xml        19 Mar 2004 04:11:11 -0000      1.2
  @@ -1,6 +1,7 @@
   <plugin>
     <id>jar</id>
     <implementation>org.apache.maven.plugin.JarPlugin</implementation>
  +  <mode>field</mode>
     <goals>
       <goal>
         <name>jar</name>
  @@ -8,11 +9,11 @@
           <prereq>test</prereq>
           <prereq>resources</prereq>
         </prereqs>
  -      <configuration>
  +      <fields>
           <jarName>#maven.final.name</jarName>
           <outputDirectory>#maven.build.dir</outputDirectory>
           <basedir>#maven.build.dest</basedir>
  -      </configuration>
  +      </fields>
       </goal>
     </goals>
   </plugin>
  
  
  
  1.2       +5 -4      
maven-components/maven-plugins/maven-resources-plugin/src/main/resources/META-INF/maven/plugin.xml
  
  Index: plugin.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-resources-plugin/src/main/resources/META-INF/maven/plugin.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- plugin.xml        15 Mar 2004 19:32:24 -0000      1.1
  +++ plugin.xml        19 Mar 2004 04:11:11 -0000      1.2
  @@ -1,20 +1,21 @@
   <plugin>
     <id>resource-copier</id>
     <implementation>org.apache.maven.plugin.ResourcesPlugin</implementation>
  +  <mode>field</mode>
     <goals>
       <goal>
         <name>resources</name>
  -      <configuration>
  +      <fields>
           <outputDirectory>#maven.build.dest</outputDirectory>
           <resources>#project.build.resources</resources>
  -      </configuration>
  +      </fields>
       </goal>
       <goal>
         <name>test:resources</name>
  -      <configuration>
  +      <fields>
           <outputDirectory>#maven.test.dest</outputDirectory>
           <resources>#project.build.unitTest.resources</resources>
  -      </configuration>
  +      </fields>
       </goal>
     </goals>
   </plugin>
  
  
  
  1.2       +7 -6      
maven-components/maven-plugins/maven-scm-plugin/src/main/resources/META-INF/maven/plugin.xml
  
  Index: plugin.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-scm-plugin/src/main/resources/META-INF/maven/plugin.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- plugin.xml        15 Mar 2004 19:32:24 -0000      1.1
  +++ plugin.xml        19 Mar 2004 04:11:11 -0000      1.2
  @@ -1,20 +1,21 @@
   <plugin>
     <id>scm</id>
     <implementation>org.apache.maven.plugin.ScmPlugin</implementation>
  +  <mode>fields</mode>
     <goals>
       <goal>
         <name>scm:checkout</name>
  -      <configuration>
  +      <fields>
           <commandName>checkout</commandName>
           <connection>#project.repository.connection</connection>
           <workingDirectory>#basedir</workingDirectory>
           <branch>#branch</branch>
           <tag>#tag</tag>
  -      </configuration>
  +      </fields>
       </goal>
       <goal>
         <name>scm:changelog</name>
  -      <configuration>
  +      <fields>
           <commandName>changelog</commandName>
           <connection>#project.repository.connection</connection>
           <workingDirectory>#basedir</workingDirectory>
  @@ -23,17 +24,17 @@
           <range>30</range>
           <startDate>#startDate</startDate>
           <endDate>#startDate</endDate>
  -      </configuration>
  +      </fields>
       </goal>
       <goal>
         <name>scm:update</name>
  -      <configuration>
  +      <fields>
           <commandName>update</commandName>
           <connection>#project.repository.connection</connection>
           <workingDirectory>#basedir</workingDirectory>
           <branch>#branch</branch>
           <tag>#tag</tag>
  -      </configuration>
  +      </fields>
       </goal>
     </goals>
   </plugin>
  
  
  
  1.2       +6 -0      maven-components/maven-plugins/maven-surefire-plugin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-surefire-plugin/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml       15 Mar 2004 19:32:22 -0000      1.1
  +++ project.xml       19 Mar 2004 04:11:11 -0000      1.2
  @@ -42,6 +42,12 @@
       <!-- Plexus -->
   
       <dependency>
  +      <groupId>maven</groupId>
  +      <artifactId>maven-core</artifactId>
  +      <version>2.0-SNAPSHOT</version>
  +    </dependency>
  +
  +    <dependency>
         <groupId>xpp3</groupId>
         <artifactId>xpp3</artifactId>
         <version>1.1.3.3</version>
  
  
  
  1.2       +5 -12     
maven-components/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java
  
  Index: SurefirePlugin.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SurefirePlugin.java       15 Mar 2004 19:32:22 -0000      1.1
  +++ SurefirePlugin.java       19 Mar 2004 04:11:11 -0000      1.2
  @@ -11,20 +11,13 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    *
    * @version $Id$
  + *
  + * @todo make version of junit and surefire configurable
  + * @todo make report to be produced configurable
    */
   public class SurefirePlugin
   {
  -    private String mavenRepoLocal;
  -
  -    private String basedir;
  -
  -    private List includes;
  -
  -    private List excludes;
  -
  -    private String[] classpathElements;
  -
  -    public void execute()
  +    public void execute( String mavenRepoLocal, String basedir, List includes, List 
excludes, String[] classpathElements )
           throws Exception
       {
           System.setProperty( "basedir", basedir );
  
  
  
  1.3       +11 -63    
maven-components/maven-plugins/maven-surefire-plugin/src/main/resources/META-INF/maven/plugin.xml
  
  Index: plugin.xml
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-plugins/maven-surefire-plugin/src/main/resources/META-INF/maven/plugin.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.xml        16 Mar 2004 00:32:22 -0000      1.2
  +++ plugin.xml        19 Mar 2004 04:11:11 -0000      1.3
  @@ -1,62 +1,7 @@
  -<!--
  -
  -This here is a clear example of some nastiness that has crept into Maven and here
  -is where it will be cleaned up. This plugin is specific to running tests with
  -surefire but it may well be a test runner for something else requiring a
  -different set of resources. The surefire plugin's concern is to run surefire
  -tests and to do that it must:
  -
  -o compile the test sources
  -o copy over the test resources
  -o run sure fire
  -
  -So currently below there are prereqs for the test:compile and test:resources
  -but it is entirely unclear what those things are doing without looking
  -at the other plugins which is not scalable. If surefire needed to add
  -foo.jar and bar.jar to the classpath for compiling there would be some
  -serious nastiness going on in order to modify the parameters of the compile.
  -
  -So, the surefire plugin should use the other plugins to satisfy its requirements
  -and by using the plugins directly it can control their use for the specific
  -purpose of running surefire tests.
  -
  -A goal is essentially a sequence of plugin executions that have been parameterized 
for
  -a specific task.
  -
  -<plugin>
  -  <id>compiler</id>
  -  <configuration>
  -    <sourceDirectory>#project.build.unitTestSourceDirectory</sourceDirectory>
  -    <outputDirectory>#maven.test.dest</outputDirectory>
  -    <classpathElements>#project.classpathElements</classpathElements>
  -    <compiler>javac</compiler>
  -  </configuration>
  -</plugin>
  -<plugin>
  -  <id>resource-copier</id>
  -  <configuration>
  -    <outputDirectory>#maven.test.dest</outputDirectory>
  -    <resources>#project.build.unitTest.resources</resources>
  -  </configuration>
  -</plugin>
  -<plugin>
  -  <id>surefire</id>
  -  <configuration>
  -    <mavenRepoLocal>#maven.repo.local</mavenRepoLocal>
  -    <basedir>#basedir</basedir>
  -    <includes>#project.build.unitTest.includes</includes>
  -    <excludes>#project.build.unitTest.excludes</excludes>
  -    <classpathElements>#project.classpathElements</classpathElements>
  -  </configuration>
  -</plugin>
  -
  -If say for example you used DbUnit or XMLUnit then the configurations for
  -each of the plugin executions would be different.
  -
  --->
   <plugin>
     <id>surefire</id>
     <implementation>org.apache.maven.test.SurefirePlugin</implementation>
  +  <mode>singleton</mode>
     <goals>
       <goal>
         <name>test</name>
  @@ -65,13 +10,16 @@
           <prereq>resources</prereq>
           <prereq>test:resources</prereq>
         </prereqs>
  -      <configuration>
  -        <mavenRepoLocal>#maven.repo.local</mavenRepoLocal>
  -        <basedir>#basedir</basedir>
  -        <includes>#project.build.unitTest.includes</includes>
  -        <excludes>#project.build.unitTest.excludes</excludes>
  -        <classpathElements>#project.classpathElements</classpathElements>
  -      </configuration>
  +      <method>
  +        <name>execute</name>
  +        <parameters>
  +          <mavenRepoLocal>#maven.repo.local</mavenRepoLocal>
  +          <basedir>#basedir</basedir>
  +          <includes>#project.build.unitTest.includes</includes>
  +          <excludes>#project.build.unitTest.excludes</excludes>
  +          <classpathElements>#project.classpathElements</classpathElements>
  +        </parameters>
  +      </method>
       </goal>
     </goals>
   </plugin>
  
  
  

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

Reply via email to