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-archiver/src/main/java/org/apache/maven/archiver MavenArchiver.java
Date Thu, 10 Mar 2005 09:44:49 GMT
evenisse    2005/03/10 01:44:49

  Modified:    maven-archiver/src/main/java/org/apache/maven/archiver
                        MavenArchiver.java
  Log:
  Add all dependencies with runtime scope in Class-Path manifest attribute if addClasspath
is true in plugin configuration
  
  Revision  Changes    Path
  1.4       +12 -13    maven-components/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java
  
  Index: MavenArchiver.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MavenArchiver.java	10 Mar 2005 09:36:44 -0000	1.3
  +++ MavenArchiver.java	10 Mar 2005 09:44:49 -0000	1.4
  @@ -76,28 +76,27 @@
           if ( addClasspath )
           {
               StringBuffer classpath = new StringBuffer();
  -            List dependencies = project.getDependencies();
  +            Set artifacts = project.getArtifacts();
   
  -            for ( Iterator iter = dependencies.iterator(); iter.hasNext(); )
  +            for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
               {
  -                Dependency dependency = (Dependency) iter.next();
  -/* TODO: need to add to jar plugin config
  -                Properties properties = dependency.getProperties();
  -                if ( Boolean.valueOf(properties.getProperty("manifest.classpath")).booleanValue())
  +                Artifact artifact = (Artifact) iter.next();
  +                if ( "jar".equals( artifact.getType() ) && Artifact.SCOPE_RUNTIME.equals(
artifact.getScope() ) )
                   {
  -                    if (classpath.length() > 0 )
  +                    if ( classpath.length() > 0 )
                       {
                           classpath.append( " " );
                       }
   
  -                    // TODO replace dependency by artifact
  -                    classpath.append( dependency.getArtifactId() + "-" + dependency.getVersion()
+ ".jar");
  +                    classpath.append( artifact.getArtifactId() + "-" + artifact.getVersion()
+ ".jar");
                   }
  -*/
               }
   
  -            Manifest.Attribute classpathAttr = new Manifest.Attribute( "Class-Path", classpath.toString()
);
  -            m.addConfiguredAttribute( classpathAttr );
  +            if ( classpath.length() > 0 )
  +            {
  +                Manifest.Attribute classpathAttr = new Manifest.Attribute( "Class-Path",
classpath.toString() );
  +                m.addConfiguredAttribute( classpathAttr );
  +            }
           }
   
           // Added supplementary entries
  
  
  

Mime
View raw message