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 2003/01/30 00:54:51 UTC
cvs commit: jakarta-turbine-maven/src/plugins-build/plexus/src/main/org/apache/maven/plexus/jelly PlexusImplementationFinderTag.java
dion 2003/01/29 15:54:51
Modified: src/java/org/apache/maven/jelly/tags/maven InputTag.java
PomTag.java ReactorTag.java ConcatTag.java
AddPathTag.java MavenTag.java
src/java/org/apache/maven/jelly MavenExpressionFactory.java
src/java/org/apache/maven/jelly/tags/jeez
MavenJeezTagLibrary.java TagDefTag.java
JeezTagLibrary.java
. project.xml
src/java/org/apache/maven/jelly/tags/werkz
LazyAttainGoalTag.java
src/plugins-build/cactus/src/main/org/apache/maven/cactus
CactusScannerTag.java
src/plugins-build/plexus/src/main/org/apache/maven/plexus/jelly
PlexusImplementationFinderTag.java
Log:
Update for latest jelly tag signature
Revision Changes Path
1.2 +4 -4 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/InputTag.java
Index: InputTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/InputTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InputTag.java 6 Jan 2003 02:05:13 -0000 1.1
+++ InputTag.java 29 Jan 2003 23:54:50 -0000 1.2
@@ -58,7 +58,7 @@
import java.io.File;
-import org.apache.commons.jelly.JellyException;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.XMLOutput;
/**
@@ -85,13 +85,13 @@
* @throws Exception If there is an error while concatenating the file.
*/
public void doTag( XMLOutput output )
- throws Exception
+ throws JellyTagException
{
ConcatTag tag = (ConcatTag) findAncestorWithClass( ConcatTag.class );
if ( tag == null )
{
- throw new JellyException( "no current concatenation" );
+ throw new JellyTagException( "no current concatenation" );
}
tag.addFile( file );
1.6 +14 -5 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/PomTag.java
Index: PomTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/PomTag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PomTag.java 11 Jan 2003 05:56:24 -0000 1.5
+++ PomTag.java 29 Jan 2003 23:54:50 -0000 1.6
@@ -58,6 +58,7 @@
import java.io.File;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.maven.MavenUtils;
@@ -107,7 +108,7 @@
* another error occurs
*/
public void doTag( XMLOutput output )
- throws Exception
+ throws JellyTagException
{
// Check to make sure that we have a valid POM
// before processing.
@@ -132,8 +133,16 @@
parentContext = plugin.getContext();
}
- context.setVariable( var, MavenUtils.getProject( projectDescriptor,
- parentContext,
- false ) );
+ try
+ {
+ context.setVariable( var,
+ MavenUtils.getProject( projectDescriptor,
+ parentContext,
+ false ) );
+ }
+ catch (Exception anException)
+ {
+ throw new JellyTagException("error getting project", anException);
+ }
}
}
1.15 +30 -12 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/ReactorTag.java
Index: ReactorTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/ReactorTag.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ReactorTag.java 28 Jan 2003 03:27:00 -0000 1.14
+++ ReactorTag.java 29 Jan 2003 23:54:50 -0000 1.15
@@ -56,6 +56,7 @@
* ====================================================================
*/
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.maven.MavenUtils;
@@ -279,7 +280,7 @@
* @throws Exception If an error occurs while processing the tag.
*/
public void doTag( XMLOutput output )
- throws Exception
+ throws JellyTagException
{
if ( getBasedir() == null )
{
@@ -303,15 +304,32 @@
System.out.println( "Starting the reactor ..." );
- List projects = MavenUtils.getProjects( getBasedir(),
- projectIncludes,
- getExcludes(),
- getMavenContext().getMavenSession().getRootContext() );
-
+ List projects = null;
+ try
+ {
+ projects = MavenUtils.getProjects( getBasedir(),
+ projectIncludes,
+ getExcludes(),
+ getMavenContext().getMavenSession().getRootContext() );
+ }
+ catch (Exception anException)
+ {
+ throw new JellyTagException("error getting projects", anException);
+ }
+
DependencyResolver dr = new DependencyResolver();
dr.setProjects( projects );
- List sortedProjects = dr.getSortedDependencies( false );
- // null out reference, as this is a long running method potentially
+
+ List sortedProjects = null;
+ try
+ {
+ sortedProjects = dr.getSortedDependencies( false );
+ }
+ catch (Exception anException)
+ {
+ throw new JellyTagException(anException);
+ }
+ // null out reference, as this is a long running method potentially
projects = null;
System.out.println( "Our processing order:" );
@@ -346,7 +364,7 @@
if ( getGoals() != null )
{
project.setGoalNames( getGoals() );
- getMavenContext().getMavenSession().attainGoals( project );
+ getMavenContext().getMavenSession().attainGoals( project );
}
if ( getPostProcessing() )
@@ -368,7 +386,7 @@
continue;
}
- throw (Exception) e.fillInStackTrace();
+ throw new JellyTagException(e.fillInStackTrace());
}
}
1.3 +43 -25 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/ConcatTag.java
Index: ConcatTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/ConcatTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConcatTag.java 6 Jan 2003 12:14:02 -0000 1.2
+++ ConcatTag.java 29 Jan 2003 23:54:50 -0000 1.3
@@ -57,10 +57,12 @@
*/
import org.apache.commons.io.FileUtils;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.XMLOutput;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -97,36 +99,52 @@
* @throws Exception If there is an error while concatenating the file.
*/
public void doTag( XMLOutput output )
- throws Exception
+ throws JellyTagException
{
- // Make sure we have an output file.
- if ( outputFile == null )
+ try
{
- throw new MissingAttributeException( "outputFile" );
- }
+ // Make sure we have an output file.
+ if ( outputFile == null )
+ {
+ throw new MissingAttributeException( "outputFile" );
+ }
- // Collect all the input files by invoking the body.
- invokeBody( output );
+ // Collect all the input files by invoking the body.
+ invokeBody( output );
- // We should now have all the files we want to concat so
- // lets do it.
- StringBuffer sb = new StringBuffer();
- for ( Iterator i = files.iterator(); i.hasNext(); )
- {
- File f = (File) i.next();
- sb.append( FileUtils.fileRead( f.getPath() ) );
- }
+ // We should now have all the files we want to concat so
+ // lets do it.
+ StringBuffer sb = new StringBuffer();
+ for ( Iterator i = files.iterator(); i.hasNext(); )
+ {
+ File f = (File) i.next();
+ sb.append( FileUtils.fileRead( f.getPath() ) );
+ }
- // If the directory where the output file is going to land
- // doesn't exists then create it.
- File outputFileDirectory = outputFile.getParentFile();
+ // If the directory where the output file is going to land
+ // doesn't exists then create it.
+ File outputFileDirectory = outputFile.getParentFile();
- if ( outputFileDirectory.exists() == false )
+ if ( outputFileDirectory.exists() == false )
+ {
+ outputFileDirectory.mkdirs();
+ }
+
+ try
+ {
+ // Now write the concatenated contents out to the file.
+ FileUtils.fileWrite( outputFile.getPath(), sb.toString() );
+ }
+ catch (Exception anException)
+ {
+ throw new JellyTagException("error writing concatenated file",
+ anException);
+ }
+ }
+ catch (IOException anException)
{
- outputFileDirectory.mkdirs();
- }
-
- // Now write the concatenated contents out to the file.
- FileUtils.fileWrite( outputFile.getPath(), sb.toString() );
+ throw new JellyTagException(anException);
+ }
+
}
}
1.5 +4 -4 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/AddPathTag.java
Index: AddPathTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/AddPathTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AddPathTag.java 13 Jan 2003 23:33:41 -0000 1.4
+++ AddPathTag.java 29 Jan 2003 23:54:50 -0000 1.5
@@ -57,7 +57,7 @@
*/
import org.apache.commons.grant.GrantProject;
-import org.apache.commons.jelly.JellyException;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.maven.jelly.tags.BaseTagSupport;
@@ -87,13 +87,13 @@
* @throws Exception when anything goes wrong. FIXME
*/
public void doTag( XMLOutput output )
- throws Exception
+ throws JellyTagException
{
GrantProject project = getMavenContext().getProject().getAntProject();
if ( project == null )
{
- throw new JellyException( "cannot find ant project" );
+ throw new JellyTagException( "cannot find ant project" );
}
if (getId() == null)
1.5 +4 -3 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/MavenTag.java
Index: MavenTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/MavenTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MavenTag.java 14 Jan 2003 08:26:39 -0000 1.4
+++ MavenTag.java 29 Jan 2003 23:54:50 -0000 1.5
@@ -56,6 +56,7 @@
* ====================================================================
*/
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.XMLOutput;
import org.apache.maven.MavenUtils;
@@ -95,7 +96,7 @@
* @throws Exception if anything goes wrong. FIXME
*/
public void doTag( XMLOutput output )
- throws Exception
+ throws JellyTagException
{
if ( getDescriptor() == null )
{
@@ -124,7 +125,7 @@
e.printStackTrace();
- throw e;
+ throw new JellyTagException(e);
}
}
1.8 +16 -7 jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenExpressionFactory.java
Index: MavenExpressionFactory.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenExpressionFactory.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- MavenExpressionFactory.java 31 Dec 2002 07:02:18 -0000 1.7
+++ MavenExpressionFactory.java 29 Jan 2003 23:54:50 -0000 1.8
@@ -57,6 +57,7 @@
*/
import org.apache.commons.jelly.JellyContext;
+import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.expression.Expression;
import org.apache.commons.jelly.expression.ExpressionFactory;
import org.apache.commons.jelly.expression.ExpressionSupport;
@@ -87,13 +88,21 @@
/** @see ExpressionFactory
*/
- public Expression createExpression( final String text )
- throws Exception
+ public Expression createExpression( final String text ) throws JellyException
{
- final Expression jexlExpression = new JexlExpression(
- org.apache.commons.jexl.ExpressionFactory.createExpression( text )
- );
-
+ Expression expression = null;
+ try
+ {
+ expression = new JexlExpression(
+ org.apache.commons.jexl.ExpressionFactory.createExpression(
+ text));
+ }
+ catch (Exception anException)
+ {
+ throw new JellyException("error evaluating expression", anException);
+ }
+
+ final Expression jexlExpression = expression;
final ExpressionFactory f = this;
if ( isSupportAntVariables() && isValidAntVariableName( text ) )
1.3 +3 -2 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/jeez/MavenJeezTagLibrary.java
Index: MavenJeezTagLibrary.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/jeez/MavenJeezTagLibrary.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MavenJeezTagLibrary.java 12 Jan 2003 05:43:07 -0000 1.2
+++ MavenJeezTagLibrary.java 29 Jan 2003 23:54:50 -0000 1.3
@@ -56,6 +56,7 @@
* ====================================================================
*/
+import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.impl.TagScript;
import org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag;
import org.xml.sax.Attributes;
@@ -89,7 +90,7 @@
*/
public TagScript createTagScript( String name, Attributes attrs )
- throws Exception
+ throws JellyException
{
// Catch the special case of <attainGoal> and substitute
// in the lazy version that loads via the Pluginmanager.
1.2 +2 -2 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/jeez/TagDefTag.java
Index: TagDefTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/jeez/TagDefTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TagDefTag.java 31 Dec 2002 07:01:52 -0000 1.1
+++ TagDefTag.java 29 Jan 2003 23:54:50 -0000 1.2
@@ -1,6 +1,6 @@
package org.apache.maven.jelly.tags.jeez;
-import org.apache.commons.jelly.JellyException;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.impl.DynamicTagLibrary;
import org.apache.commons.jelly.tags.define.TagTag;
@@ -28,7 +28,7 @@
/**
* @return the current JeezTagLibrary instance
*/
- protected DynamicTagLibrary getTagLibrary() throws JellyException
+ protected DynamicTagLibrary getTagLibrary() throws JellyTagException
{
return tagLibrary;
}
1.3 +4 -3 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/jeez/JeezTagLibrary.java
Index: JeezTagLibrary.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/jeez/JeezTagLibrary.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JeezTagLibrary.java 12 Jan 2003 05:43:07 -0000 1.2
+++ JeezTagLibrary.java 29 Jan 2003 23:54:50 -0000 1.3
@@ -1,5 +1,6 @@
package org.apache.maven.jelly.tags.jeez;
+import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.Tag;
import org.apache.commons.jelly.TagLibrary;
import org.apache.commons.jelly.impl.DynamicTagLibrary;
@@ -33,7 +34,7 @@
public TagScript createTagScript(
final String name,
Attributes attrs
- ) throws Exception
+ ) throws JellyException
{
if ( name.equals( "tagdef" ) )
@@ -70,7 +71,7 @@
return new TagScript(
new TagFactory()
{
- public Tag createTag( String name, Attributes attributes ) throws Exception
+ public Tag createTag( String name, Attributes attributes ) throws JellyException
{
// lets try create a dynamic tag first
Tag tag = JeezTagLibrary.this.createTag( name, attributes );
1.243 +3 -3 jakarta-turbine-maven/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/project.xml,v
retrieving revision 1.242
retrieving revision 1.243
diff -u -r1.242 -r1.243
--- project.xml 29 Jan 2003 16:50:34 -0000 1.242
+++ project.xml 29 Jan 2003 23:54:51 -0000 1.243
@@ -295,7 +295,7 @@
<role>Release Manager</role>
</roles>
</developer>
-
+
<developer>
<name>Ben Walding</name>
<id>bwalding</id>
@@ -363,7 +363,7 @@
<name>Kuisong Tong</name>
<email>Kuisong.Tong@vtradex.com</email>
</contributor>
-
+
</contributors>
<!-- Need to mark these as compile-time/run-time -->
@@ -451,7 +451,7 @@
<dependency>
<id>werkz</id>
- <version>1.0-beta-5</version>
+ <version>1.0-beta-6</version>
<url>http://werkz.sourceforge.net/</url>
</dependency>
1.2 +18 -11 jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/werkz/LazyAttainGoalTag.java
Index: LazyAttainGoalTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/werkz/LazyAttainGoalTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LazyAttainGoalTag.java 31 Dec 2002 07:02:01 -0000 1.1
+++ LazyAttainGoalTag.java 29 Jan 2003 23:54:51 -0000 1.2
@@ -56,6 +56,7 @@
* ====================================================================
*/
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.XMLOutput;
import com.werken.werkz.jelly.AttainGoalTag;
import org.apache.maven.jelly.MavenJellyContext;
@@ -92,16 +93,22 @@
*
* @throws Exception If an error occurs while executing the tag.
*/
- public void doTag( XMLOutput output )
- throws Exception
+ public void doTag(XMLOutput output) throws JellyTagException
{
- // Perform initialization before passing to parent
- // which assumes all goals and prereqs in the chain
- // have been loaded already.
- Project p = (Project) getContext().getVariable( MavenConstants.MAVEN_POM );
- MavenSession session = ((MavenJellyContext) getContext()).getMavenSession();
- session.prepForGoal( getName(), p );
-
- super.doTag( output );
+ try
+ {
+ // Perform initialization before passing to parent
+ // which assumes all goals and prereqs in the chain
+ // have been loaded already.
+ Project p = (Project) getContext().getVariable( MavenConstants.MAVEN_POM );
+ MavenSession session = ((MavenJellyContext) getContext()).getMavenSession();
+ session.prepForGoal( getName(), p );
+
+ super.doTag( output );
+ }
+ catch (Exception anException)
+ {
+ throw new JellyTagException(anException);
+ }
}
}
1.2 +19 -4 jakarta-turbine-maven/src/plugins-build/cactus/src/main/org/apache/maven/cactus/CactusScannerTag.java
Index: CactusScannerTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/cactus/src/main/org/apache/maven/cactus/CactusScannerTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CactusScannerTag.java 24 Jan 2003 03:44:39 -0000 1.1
+++ CactusScannerTag.java 29 Jan 2003 23:54:51 -0000 1.2
@@ -55,6 +55,9 @@
*
* ====================================================================
*/
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.jelly.MissingAttributeException;
@@ -128,7 +131,7 @@
/**
* @see TagSupport#doTag(XMLOutput)
*/
- public void doTag(XMLOutput xmlOutput) throws Exception
+ public void doTag(XMLOutput xmlOutput) throws JellyTagException
{
this.cactusScanner.setProject(AntTagLibrary.getProject(context));
this.cactusScanner.clear();
@@ -172,9 +175,21 @@
/**
* @see TaskSource#setTaskProperty(String, Object)
*/
- public void setTaskProperty(String name, Object value) throws Exception
+ public void setTaskProperty(String name, Object value) throws JellyTagException
{
- BeanUtils.setProperty(this, name, value);
+ try
+ {
+ BeanUtils.setProperty(this, name, value);
+ }
+ catch (IllegalAccessException anException)
+ {
+ throw new JellyTagException(anException);
+ }
+ catch (InvocationTargetException anException)
+ {
+ throw new JellyTagException(anException);
+ }
+
}
/**
1.2 +3 -2 jakarta-turbine-maven/src/plugins-build/plexus/src/main/org/apache/maven/plexus/jelly/PlexusImplementationFinderTag.java
Index: PlexusImplementationFinderTag.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/src/main/org/apache/maven/plexus/jelly/PlexusImplementationFinderTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PlexusImplementationFinderTag.java 28 Jan 2003 00:16:18 -0000 1.1
+++ PlexusImplementationFinderTag.java 29 Jan 2003 23:54:51 -0000 1.2
@@ -2,6 +2,7 @@
import java.io.File;
+import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.MissingAttributeException;
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
@@ -43,7 +44,7 @@
/** Execute the tag. */
public void doTag(XMLOutput output)
- throws Exception
+ throws JellyTagException
{
// Create a new pipeline and set the id.
PlexusImplementationFinder finder = new PlexusImplementationFinder();