You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by di...@apache.org on 2004/01/03 05:09:31 UTC
cvs commit: maven/src/java/org/apache/maven/project Project.java
dion 2004/01/02 20:09:31
Modified: src/java/org/apache/maven/project Tag: MAVEN-1_0-BRANCH
Project.java
Log:
Code cleanup
Revision Changes Path
No revision
No revision
1.91.4.5 +44 -27 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.91.4.4
retrieving revision 1.91.4.5
diff -u -r1.91.4.4 -r1.91.4.5
--- Project.java 2 Jan 2004 23:32:10 -0000 1.91.4.4
+++ Project.java 3 Jan 2004 04:09:31 -0000 1.91.4.5
@@ -265,13 +265,13 @@
}
return mavenXml;
}
-
+
/**
* @return true if the maven.xml file for the project exists
*/
public boolean hasMavenXml()
{
- return getMavenXml().exists();
+ return getMavenXml().exists();
}
// ----------------------------------------------------------------------
@@ -279,6 +279,9 @@
// ----------------------------------------------------------------------
// trying to align dep.id with project.id
+ /**
+ * @return the id of the project
+ */
public String getId()
{
// The id has already been set.
@@ -373,7 +376,7 @@
/**
* Set the context attribute.
*
- * @param context
+ * @param context the context to use
*/
public void setContext( MavenJellyContext context )
{
@@ -391,9 +394,9 @@
}
/**
- * Set the attribute.
+ * Set the artifactList attribute.
*
- * @param artifactList
+ * @param artifactList list of artifacts for the project
*/
public void setArtifacts( List artifactList )
{
@@ -450,6 +453,9 @@
return pomToExtend;
}
+ /**
+ * @return the project that this one extends, if any
+ */
public Project getParent()
{
return parent;
@@ -465,6 +471,10 @@
return getParent() != null;
}
+ /**
+ * Set the project that this one extends
+ * @param parent the parent project
+ */
public void setParent( Project parent )
{
this.parent = parent;
@@ -489,7 +499,7 @@
{
return new File( parentBasedir(), MavenConstants.BUILD_FILE_NAME );
}
-
+
/**
* Set the gump repository descriptor.
*
@@ -530,6 +540,9 @@
return shortDescription;
}
+ /**
+ * @return the directory name for this proejct's artifacts
+ */
public String getArtifactDirectory()
{
if ( isValid( getGroupId() ) )
@@ -667,7 +680,7 @@
/**
* @todo eventually, just use sets instead.
* @param srcList source list to add items from
- * @param targetList target list to add unique items to
+ * @param targetList target list to add unique items to
*/
static void mergeLists(List srcList, List targetList)
{
@@ -767,7 +780,7 @@
public void addReport( String report )
{
String reportName = StringTool.trim(report);
- if ( reports.contains( reportName ) == false )
+ if ( !reports.contains( reportName ) )
{
reports.add( reportName );
}
@@ -776,7 +789,7 @@
/**
* Set a list of dependencies.
*
- * @param reports
+ * @param reports the reports this project will produce
*/
public void setReports( List reports )
{
@@ -1227,7 +1240,7 @@
{
versionMap = new HashMap();
- for ( Iterator i = versions.iterator(); i.hasNext(); )
+ for ( Iterator i = versions.iterator(); i.hasNext();)
{
Version version = (Version) i.next();
versionMap.put( version.getId(), version );
@@ -1359,6 +1372,7 @@
*
* @throws RepoConfigException If an error occurs checking the local settings.
* @throws UnsatisfiedDependencyException If an error occurs due to missing exceptions.
+ * @throws ChecksumVerificationException if the downloaded files fail verification
*/
public void verifyDependencies()
throws RepoConfigException,
@@ -1426,8 +1440,8 @@
* We don't want users to have to alter any usage until we have properly
* deprecated the use of the <groupId> form.
*
- * @param id
- * @return
+ * @param id the legacy id to convert
+ * @return the id in standard format
*/
public static String legacyToStandardId( String id )
{
@@ -1459,8 +1473,8 @@
* We don't want users to have to alter any usage until we have properly
* deprecated the use of the <groupId> form.
*
- * @param id
- * @return
+ * @param id the standard id to convert
+ * @return the id in legacy format
*/
public static String standardToLegacyId( String id )
{
@@ -1477,8 +1491,9 @@
/**
* Process the dependencies of the project, adding dependencies to the
* appropriate classloader etc
- *
- * @throws MalformedURLException
+ *
+ * @throws MalformedURLException if a file can't be converted to a URL.
+ * @throws Exception for any other issue. FIXME
*/
public void processDependencies() throws MalformedURLException, Exception
{
@@ -1487,16 +1502,16 @@
log.debug("No dependencies to process for project " + getName());
return;
}
-
+
// This may definitely break plugins.
ClassLoader projectClassLoader = getContext().getClassLoader();
-
+
if ( projectClassLoader instanceof ForeheadClassLoader )
{
// add the dependencies to the classpath
- for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
+ for ( Iterator i = getArtifacts().iterator(); i.hasNext();)
{
- ForeheadClassLoader loader = (ForeheadClassLoader)projectClassLoader;
+ ForeheadClassLoader loader = (ForeheadClassLoader) projectClassLoader;
Artifact artifact = (Artifact) i.next();
Dependency dependency = artifact.getDependency();
if (dependency.isPlugin())
@@ -1511,15 +1526,16 @@
String classLoader = artifact.getDependency().getProperty( "classloader" );
if (classLoader != null)
{
- loader = Forehead.getInstance().getClassLoader( classLoader );
+ loader = Forehead.getInstance().getClassLoader( classLoader );
if (loader == null)
{
log.info("classloader '" + classLoader
- + "' not found. Adding dependencies to the project classloader instead");
- loader = (ForeheadClassLoader)projectClassLoader;
+ + "' not found. Adding dependencies to "
+ + "the project classloader instead");
+ loader = (ForeheadClassLoader) projectClassLoader;
}
}
-
+
// add to classloader
if (artifact.exists())
{
@@ -1641,7 +1657,8 @@
{
build = parent.build;
}
- else {
+ else
+ {
build.mergeParent(parent.build);
}
@@ -1653,7 +1670,7 @@
mergeLists(parent.reports, reports);
mergeLists(parent.packageGroups, packageGroups);
- // Now let's do some magic with versions and dependencies as they have maps.
+ // Now let's do some magic with versions and dependencies as they have maps.
// We take all the parent's and put them in with the child's.
addParentVersions(parent.versions);
addParentDependencies(parent.dependencies);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org