jvanzyl 2004/04/02 10:31:44
Modified: maven-core/src/main/java/org/apache/maven DefaultMaven.java
Log:
o adding explicit support for the execution of a goal without a project being
present.
Revision Changes Path
1.10 +15 -37
maven-components/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
Index: DefaultMaven.java
===================================================================
RCS file:
/home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/DefaultMaven.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DefaultMaven.java 21 Mar 2004 00:33:17 -0000 1.9
+++ DefaultMaven.java 2 Apr 2004 18:31:44 -0000 1.10
@@ -42,58 +42,28 @@
public Set getAllGoalNames()
{
- //return getPluginManager().getGoalNames();
return new HashSet();
}
public String getGoalDescription( String goalName )
{
return "desc";
- //return getPluginManager().getGoalDescription( goalName );
}
- public void attainGoals( File projectFile, List goals )
- throws Exception
- {
- if ( projectFile.exists() )
- {
- if ( projectFile.length() == 0 )
- {
- throw new Exception( i18n.format( "empty.descriptor.error",
projectFile.getName() ) );
- }
- }
-
- MavenProject project = null;
-
- try
- {
- project = getProject( projectFile );
- }
- catch ( Exception e )
- {
- project = null;
- }
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
- attainGoals( project, goals );
- }
-
- public void attainGoal( File projectFile, String goal )
+ public void attainGoal( String goal )
throws Exception
{
- MavenProject project = getProject( projectFile );
-
- attainGoal( project, goal );
+ attainGoal( (MavenProject)null, goal );
}
- public void attainGoals( MavenProject project, List goals )
+ public void attainGoal( File projectFile, String goal )
throws Exception
{
- for ( Iterator i = goals.iterator(); i.hasNext(); )
- {
- String goal = (String) i.next();
-
- attainGoal( project, goal );
- }
+ attainGoal( getProject( projectFile) , goal );
}
public void attainGoal( MavenProject project, String goal )
@@ -107,6 +77,10 @@
}
}
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
public MavenProject getProject( File project )
throws Exception
{
@@ -118,6 +92,10 @@
{
return projectBuilder.build( project, useParent );
}
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
public List getSortedProjects( List projects )
throws Exception
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]