dion 2003/08/03 23:27:56
Modified: src/java/org/apache/maven/plugin PluginManager.java
src/java/org/apache/maven/project Project.java
Log:
Move maven.xml definition off to project
Revision Changes Path
1.62 +8 -14 maven/src/java/org/apache/maven/plugin/PluginManager.java
Index: PluginManager.java
===================================================================
RCS file: /home/cvs/maven/src/java/org/apache/maven/plugin/PluginManager.java,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- PluginManager.java 4 Aug 2003 04:30:39 -0000 1.61
+++ PluginManager.java 4 Aug 2003 06:27:56 -0000 1.62
@@ -402,26 +402,20 @@
// FIXME: Part of this belongs as a method on Project, e.g. the name and
// construction of maven.xml
// Project's Jelly script
- if ( project.getFile() != null )
+ if ( project.hasMavenXml() )
{
- // maven.xml
- File f = new File( project.getFile().getParentFile(),
MavenConstants.BUILD_FILE_NAME );
-
- if ( f.exists() )
- {
- //!!! This is the cause of the classloader problems!!
- JellyScriptHousing jellyScriptHousing = createJellyScriptHousing(
project, null, f );
- mapper.parse( new FileReader( f ), jellyScriptHousing );
- runJellyScriptHousing( jellyScriptHousing, baseContext );
- }
+ File mavenXml = project.getMavenXml();
+ //!!! This is the cause of the classloader problems!!
+ JellyScriptHousing jellyScriptHousing = createJellyScriptHousing(
project, null, mavenXml );
+ mapper.parse( new FileReader( mavenXml ), jellyScriptHousing );
+ runJellyScriptHousing( jellyScriptHousing, baseContext );
}
// Parent's Jelly script
// FIXME: What about further up the chain?
- if ( project.hasParent() )
+ if ( project.hasParent() && project.getParent().hasMavenXml() )
{
// FIXME: this is a badly named method
-
File f = project.parentMavenXml();
if ( f.exists() )
1.87 +24 -1 maven/src/java/org/apache/maven/project/Project.java
Index: Project.java
===================================================================
RCS file: /home/cvs/maven/src/java/org/apache/maven/project/Project.java,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- Project.java 4 Aug 2003 01:11:13 -0000 1.86
+++ Project.java 4 Aug 2003 06:27:56 -0000 1.87
@@ -227,6 +227,9 @@
/** The maven session this project is running in. */
private Maven maven;
+
+ /** the maven.xml file for this project */
+ private File mavenXml;
public Project getParent()
{
@@ -466,6 +469,26 @@
public File parentMavenXml()
{
return new File( parentBasedir(), MavenConstants.BUILD_FILE_NAME );
+ }
+
+ /**
+ * @return the maven.xml file
+ */
+ public File getMavenXml()
+ {
+ if (mavenXml == null)
+ {
+ mavenXml = new File( getFile().getParentFile(),
MavenConstants.BUILD_FILE_NAME );
+ }
+ return mavenXml;
+ }
+
+ /**
+ * @return true if the maven.xml file for the project exists
+ */
+ public boolean hasMavenXml()
+ {
+ return getMavenXml().exists();
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]