maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject cvs commit: maven-components/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war WarMojo.java
Date Wed, 09 Mar 2005 06:45:33 GMT
evenisse    2005/03/08 22:45:33

  Modified:    maven-core-it/it0016 pom.xml
               maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war
                        WarMojo.java
  Log:
  Add dependencies in war and add support of scope deps
  
  Revision  Changes    Path
  1.2       +13 -0     maven-components/maven-core-it/it0016/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core-it/it0016/pom.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- pom.xml	3 Mar 2005 09:08:47 -0000	1.1
  +++ pom.xml	9 Mar 2005 06:45:33 -0000	1.2
  @@ -4,4 +4,17 @@
     <artifactId>maven-core-it0016</artifactId>
     <type>war</type>
     <version>1.0</version>
  +  <dependencies>
  +    <dependency>
  +      <groupId>commons-logging</groupId>
  +      <artifactId>commons-logging</artifactId>
  +      <version>1.0.3</version>
  +      <scope>runtime</scope>
  +    </dependency>
  +    <dependency>
  +      <groupId>servletapi</groupId>
  +      <artifactId>servletapi</artifactId>
  +      <version>2.3</version>
  +    </dependency>
  +  </dependencies>
   </project>
  
  
  
  1.6       +7 -18     maven-components/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java
  
  Index: WarMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WarMojo.java	8 Mar 2005 06:39:50 -0000	1.5
  +++ WarMojo.java	9 Mar 2005 06:45:33 -0000	1.6
  @@ -23,7 +23,6 @@
   
   import org.apache.maven.archiver.MavenArchiver;
   import org.apache.maven.artifact.Artifact;
  -import org.apache.maven.artifact.repository.ArtifactRepository;
   import org.apache.maven.plugin.AbstractPlugin;
   import org.apache.maven.plugin.PluginExecutionRequest;
   import org.apache.maven.plugin.PluginExecutionResponse;
  @@ -144,12 +143,6 @@
    *  validator=""
    *  expression="#project.build.directory"
    *  description=""
  - * @parameter name="localRepository"
  - *  type="org.apache.maven.artifact.repository.ArtifactRepository"
  - *  required="true"
  - *  validator=""
  - *  expression="#localRepository"
  - *  description=""
    * @parameter
    *  name="project"
    *  type="org.apache.maven.project.MavenProject"
  @@ -172,8 +165,6 @@
   
       private MavenProject project;
   
  -    private ArtifactRepository localRepository;
  -
       private File classesDirectory;
   
       private String outputDirectory;
  @@ -211,13 +202,12 @@
       }
   
       /**
  -     * @todo properties 'war.bundle' and 'war.target.path'
  -     * @todo copy classes to classes webapp directory
  +     * @todo properties 'war.target.path'
        */
       public void buildWebapp( MavenProject project )
           throws IOException
       {
  -        request.getLog().info( "Assembling webapp " + project.getArtifactId() );
  +        request.getLog().info( "Assembling webapp " + project.getArtifactId() + " in "
+ webappDirectory.getAbsolutePath() );
   
           File libDirectory = new File( webappDirectory, WEB_INF + "/lib" );
   
  @@ -235,13 +225,14 @@
           for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
           {
               Artifact artifact = (Artifact) iter.next();
  -            if ( "jar".equals( artifact.getType() ) )
  +
  +            if ( "jar".equals( artifact.getType() ) && Artifact.SCOPE_RUNTIME.equals(
artifact.getScope() ) )
               {
  -                FileUtils.copyFileToDirectory( new File( localRepository.getBasedir(),
artifact.toString() ) , libDirectory );
  +                FileUtils.copyFileToDirectory( artifact.getFile() , libDirectory );
               }
               if ( "tld".equals( artifact.getType() ) )
               {
  -                FileUtils.copyFileToDirectory( new File( localRepository.getBasedir(),
artifact.toString() ) , tldDirectory );
  +                FileUtils.copyFileToDirectory( artifact.getFile() , tldDirectory );
               }
           }
       }
  @@ -318,8 +309,6 @@
   
           project = (MavenProject) request.getParameter( "project" );
   
  -        localRepository = (ArtifactRepository) request.getParameter( "localRepository"
);
  -
           classesDirectory = new File( (String) request.getParameter( "classesDirectory"
) );
   
           outputDirectory = (String) request.getParameter( "outputDirectory" );
  
  
  

Mime
View raw message