maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r774509 - /maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
Date Wed, 13 May 2009 20:18:24 GMT
Author: bentmann
Date: Wed May 13 20:18:24 2009
New Revision: 774509

URL: http://svn.apache.org/viewvc?rev=774509&view=rev
Log:
o Restored deleted methods for backward-compat with existing plugins like javadoc
o Deprecated similar methods for other scopes

Modified:
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/MavenProject.java

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/MavenProject.java?rev=774509&r1=774508&r2=774509&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
(original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
Wed May 13 20:18:24 2009
@@ -511,14 +511,58 @@
             }
         }
 
-        /*
-        System.out.println( "CLASSPATH: ");
-        for( String s : list )
+        return list;
+    }
+
+    @Deprecated
+    public List<Artifact> getCompileArtifacts()
+    {
+        List<Artifact> list = new ArrayList<Artifact>( getArtifacts().size()
);
+
+        for ( Artifact a : getArtifacts() )
         {
-            System.out.println( ">>>>> " + s );
-        } 
-        */           
-        
+            // TODO: classpath check doesn't belong here - that's the other method
+            if ( a.getArtifactHandler().isAddedToClasspath() )
+            {
+                // TODO: let the scope handler deal with this
+                if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals(
a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
+                {
+                    list.add( a );
+                }
+            }
+        }
+        return list;
+    }
+
+    @Deprecated
+    public List<Dependency> getCompileDependencies()
+    {
+        Set<Artifact> artifacts = getArtifacts();
+
+        if ( ( artifacts == null ) || artifacts.isEmpty() )
+        {
+            return Collections.emptyList();
+        }
+
+        List<Dependency> list = new ArrayList<Dependency>( artifacts.size() );
+
+        for ( Artifact a : getArtifacts()  )
+        {
+            // TODO: let the scope handler deal with this
+            if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals(
a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
+            {
+                Dependency dependency = new Dependency();
+
+                dependency.setArtifactId( a.getArtifactId() );
+                dependency.setGroupId( a.getGroupId() );
+                dependency.setVersion( a.getVersion() );
+                dependency.setScope( a.getScope() );
+                dependency.setType( a.getType() );
+                dependency.setClassifier( a.getClassifier() );
+
+                list.add( dependency );
+            }
+        }
         return list;
     }
 
@@ -626,6 +670,7 @@
         return list;
     }
 
+    @Deprecated
     public List<Artifact> getRuntimeArtifacts()
     {
         List<Artifact> list = new ArrayList<Artifact>( getArtifacts().size()
);
@@ -645,6 +690,7 @@
         return list;
     }
 
+    @Deprecated
     public List<Dependency> getRuntimeDependencies()
     {
         Set<Artifact> artifacts = getArtifacts();
@@ -697,6 +743,7 @@
         return list;
     }
 
+    @Deprecated
     public List<Artifact> getSystemArtifacts()
     {
         List<Artifact> list = new ArrayList<Artifact>( getArtifacts().size()
);
@@ -716,6 +763,7 @@
         return list;
     }
 
+    @Deprecated
     public List<Dependency> getSystemDependencies()
     {
         Set<Artifact> artifacts = getArtifacts();



Mime
View raw message