You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/10/31 23:23:55 UTC
svn commit: r469680 - in
/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis:
MojoSupport.java ant/AntMojoSupport.java ant/MavenAntLoggerAdapter.java
Author: jdillon
Date: Tue Oct 31 14:23:54 2006
New Revision: 469680
URL: http://svn.apache.org/viewvc?view=rev&rev=469680
Log:
Update some javadoc
Modified:
geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java
geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java
geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/MavenAntLoggerAdapter.java
Modified: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java?view=diff&rev=469680&r1=469679&r2=469680
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java (original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/MojoSupport.java Tue Oct 31 14:23:54 2006
@@ -95,6 +95,9 @@
/**
* Initializes logging. Called by {@link #execute}.
+ *
+ * @throws MojoExecutionException Initialization failed
+ * @throws MojoFailureException Initialization failed
*/
protected void init() throws MojoExecutionException, MojoFailureException {
this.log = getLog();
@@ -150,7 +153,7 @@
/**
* Sub-class should override to provide custom execution logic.
*
- * @throws Exception
+ * @throws Exception Execution failed
*/
protected void doExecute() throws Exception {
// Empty
@@ -165,6 +168,9 @@
*
* <p>
* Sub-class must overridde to provide access.
+ * </p>
+ *
+ * @return The maven project; never null
*/
protected MavenProject getProject() {
throw new Error("Sub-class must override to provide access to : " + MavenProject.class);
@@ -175,6 +181,9 @@
*
* <p>
* Sub-class must overridde to provide access.
+ * </p>
+ *
+ * @return An artifact repository; never null
*/
protected ArtifactRepository getArtifactRepository() {
throw new Error("Sub-class must override to provide access to: " + ArtifactRepository.class);
@@ -182,6 +191,8 @@
/**
* Get the artifact factory.
+ *
+ * @return An artifact factory; never null
*/
protected final ArtifactFactory getArtifactFactory() {
return dependencyHelper.getArtifactFactory();
@@ -189,6 +200,8 @@
/**
* Get the artifact resolver.
+ *
+ * @return An artifact resolver; never null
*/
protected final ArtifactResolver getArtifactResolver() {
return dependencyHelper.getArtifactResolver();
@@ -197,8 +210,15 @@
/**
* Create a new artifact. If no version is specified, it will be retrieved from the dependency
* list or from the DependencyManagement section of the pom.
+ *
+ * @param item The item to create an artifact for
+ * @return An unresolved artifact for the given item.
+ *
+ * @throws MojoExecutionException Failed to create artifact
*/
protected Artifact createArtifact(final ArtifactItem item) throws MojoExecutionException {
+ assert item != null;
+
if (item.getVersion() == null) {
fillMissingArtifactVersion(item);
@@ -220,22 +240,28 @@
throw new MojoExecutionException("Could not create range for version: " + item.getVersion(), e);
}
- Artifact artifact = getArtifactFactory().createDependencyArtifact(
+ return getArtifactFactory().createDependencyArtifact(
item.getGroupId(),
item.getArtifactId(),
range,
item.getType(),
item.getClassifier(),
Artifact.SCOPE_PROVIDED);
-
- return artifact;
}
/**
* Resolves the Artifact from the remote repository if nessessary. If no version is specified, it will
* be retrieved from the dependency list or from the DependencyManagement section of the pom.
+ *
+ *
+ * @param item The item to create an artifact for; must not be null
+ * @return The artifact for the given item
+ *
+ * @throws MojoExecutionException Failed to create artifact
*/
protected Artifact getArtifact(final ArtifactItem item) throws MojoExecutionException {
+ assert item != null;
+
Artifact artifact = createArtifact(item);
return resolveArtifact(artifact);
@@ -244,8 +270,16 @@
/**
* Resolves the Artifact from the remote repository if nessessary. If no version is specified, it will
* be retrieved from the dependency list or from the DependencyManagement section of the pom.
+ *
+ * @param artifact The artifact to be resolved; must not be null
+ * @param transitive True to resolve the artifact transitivly
+ * @return The resolved artifact; never null
+ *
+ * @throws MojoExecutionException Failed to resolve artifact
*/
protected Artifact resolveArtifact(final Artifact artifact, final boolean transitive) throws MojoExecutionException {
+ assert artifact != null;
+
try {
if (transitive) {
getArtifactResolver().resolveTransitively(
@@ -273,8 +307,14 @@
}
/**
- * Resolves the Artifact from the remote repository if nessessary. If no version is specified, it will
- * be retrieved from the dependency list or from the DependencyManagement section of the pom.
+ * Resolves the Artifact from the remote repository non-transitivly.
+ *
+ * @param artifact The artifact to be resolved; must not be null
+ * @return The resolved artifact; never null
+ *
+ * @throws MojoExecutionException Failed to resolve artifact
+ *
+ * @see #resolveArtifact(Artifact,boolean)
*/
protected Artifact resolveArtifact(final Artifact artifact) throws MojoExecutionException {
return resolveArtifact(artifact, false);
@@ -283,6 +323,8 @@
/**
* Tries to find missing version from dependancy list and dependency management.
* If found, the artifact is updated with the correct version.
+ *
+ * @param item The item to fill in missing version details into
*/
private void fillMissingArtifactVersion(final ArtifactItem item) {
log.debug("Attempting to find missing version in " + item.getGroupId() + ":" + item.getArtifactId());
Modified: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java?view=diff&rev=469680&r1=469679&r2=469680
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java (original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/AntMojoSupport.java Tue Oct 31 14:23:54 2006
@@ -36,7 +36,6 @@
import org.apache.tools.ant.taskdefs.Mkdir;
import org.apache.tools.ant.taskdefs.Property;
-import org.apache.geronimo.genesis.ant.MavenAntLoggerAdapter;
import org.apache.geronimo.genesis.MojoSupport;
/**
Modified: geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/MavenAntLoggerAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/MavenAntLoggerAdapter.java?view=diff&rev=469680&r1=469679&r2=469680
==============================================================================
--- geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/MavenAntLoggerAdapter.java (original)
+++ geronimo/genesis/trunk/plugins/plugin-support/src/main/java/org/apache/geronimo/genesis/ant/MavenAntLoggerAdapter.java Tue Oct 31 14:23:54 2006
@@ -32,7 +32,7 @@
* @version $Rev$ $Date$
*/
public class MavenAntLoggerAdapter
- extends DefaultLogger
+ extends DefaultLogger
{
protected Log log;