From 4487d95d9515b6ffddf0deba9a46f7d26eac596f Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sun, 24 Oct 2004 18:13:54 +0000 Subject: [PATCH] o removal of xstream and bits of cruft git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163213 13f79535-47bb-0310-9956-ffa450edef68 --- maven-plugin/pom.xml | 5 -- .../maven/plugin/BeanPluginAdapter.java | 69 ------------------- .../plugin/descriptor/MojoDescriptor.java | 2 - .../plugin/descriptor/PluginDescriptor.java | 1 + .../descriptor/PluginDescriptorBuilder.java | 60 ---------------- .../java/org/apache/maven/plugin/Bean.java | 50 -------------- .../org/apache/maven/plugin/BeanTest.java | 43 ------------ 7 files changed, 1 insertion(+), 229 deletions(-) delete mode 100644 maven-plugin/src/main/java/org/apache/maven/plugin/BeanPluginAdapter.java delete mode 100644 maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java delete mode 100644 maven-plugin/src/test/java/org/apache/maven/plugin/Bean.java delete mode 100644 maven-plugin/src/test/java/org/apache/maven/plugin/BeanTest.java diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index f002e03006..0dec2c9672 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -17,11 +17,6 @@ qdox 1.2 - - xstream - xstream - 1.0-SNAPSHOT - modello modello diff --git a/maven-plugin/src/main/java/org/apache/maven/plugin/BeanPluginAdapter.java b/maven-plugin/src/main/java/org/apache/maven/plugin/BeanPluginAdapter.java deleted file mode 100644 index e022fb3a5e..0000000000 --- a/maven-plugin/src/main/java/org/apache/maven/plugin/BeanPluginAdapter.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.apache.maven.plugin; - -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.util.Map; -import java.util.HashMap; - -/** - * Adapt a maven2 plugin for use as a bean with setters that can be used - * within Jelly and Ant. - * - * @author Jason van Zyl - * @version $Id$ - */ -public class BeanPluginAdapter -{ - private Map parameters; - - private Plugin plugin; - - public BeanPluginAdapter( Plugin plugin ) - { - this.plugin = plugin; - - parameters = new HashMap(); - } - - // ---------------------------------------------------------------------- - // - // ---------------------------------------------------------------------- - - public void execute() - throws Exception - { - PluginExecutionRequest request = new PluginExecutionRequest( parameters ); - - PluginExecutionResponse response = new PluginExecutionResponse(); - - plugin.execute( request, response ); - } - - // ---------------------------------------------------------------------- - // - // ---------------------------------------------------------------------- - - protected void addParameter( String key, Object value ) - { - parameters.put( key, value ); - } - - protected Plugin getPlugin() - { - return plugin; - } -} diff --git a/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java b/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java index 019e85d6c3..5ea72f17be 100644 --- a/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java +++ b/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java @@ -16,8 +16,6 @@ package org.apache.maven.plugin.descriptor; * limitations under the License. */ -import org.apache.maven.plugin.descriptor.Parameter; - import java.util.HashMap; import java.util.Iterator; import java.util.List; diff --git a/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java b/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java index c54711b95e..43551dcc17 100644 --- a/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java +++ b/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java @@ -18,6 +18,7 @@ package org.apache.maven.plugin.descriptor; import java.util.LinkedList; import java.util.List; +import java.util.ArrayList; /** * @author Jason van Zyl diff --git a/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java b/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java deleted file mode 100644 index ef26fca9df..0000000000 --- a/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.apache.maven.plugin.descriptor; - -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.alias.DefaultClassMapper; -import com.thoughtworks.xstream.alias.DefaultNameMapper; -import com.thoughtworks.xstream.objecttree.reflection.JavaReflectionObjectFactory; -import com.thoughtworks.xstream.xml.xpp3.Xpp3DomBuilder; -import com.thoughtworks.xstream.xml.xpp3.Xpp3DomXMLReader; -import com.thoughtworks.xstream.xml.xpp3.Xpp3DomXMLReaderDriver; - -import java.io.Reader; - -/** - * @author Jason van Zyl - * @version $Id$ - */ -public class PluginDescriptorBuilder -{ - private XStream xstream; - - public PluginDescriptorBuilder() - { - xstream = new XStream( new JavaReflectionObjectFactory(), - new DefaultClassMapper( new DefaultNameMapper() ), - new Xpp3DomXMLReaderDriver(), - "implementation" ); - - xstream.alias( "plugin", PluginDescriptor.class ); - - xstream.alias( "mojo", MojoDescriptor.class ); - - xstream.alias( "prereq", String.class ); - - xstream.alias( "parameter", Parameter.class ); - - xstream.alias( "dependency", Dependency.class ); - } - - public PluginDescriptor build( Reader reader ) - throws Exception - { - return (PluginDescriptor) xstream.fromXML( new Xpp3DomXMLReader( Xpp3DomBuilder.build( reader ) ) ); - } -} diff --git a/maven-plugin/src/test/java/org/apache/maven/plugin/Bean.java b/maven-plugin/src/test/java/org/apache/maven/plugin/Bean.java deleted file mode 100644 index 63b1ecf53c..0000000000 --- a/maven-plugin/src/test/java/org/apache/maven/plugin/Bean.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.apache.maven.plugin; - -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @author Jason van Zyl - * @version $Id$ - */ -public class Bean - extends BeanPluginAdapter -{ - public Bean() - { - super( new TestPlugin() ); - } - - public void setName( String name ) - { - addParameter( "name", name ); - } - - public void setArtifactId( String artifactId ) - { - addParameter( "artifactId", artifactId ); - } - - public void setFoo( String foo ) - { - addParameter( "foo", foo ); - } - - public boolean hasExecuted() - { - return ((TestPlugin)getPlugin()).hasExecuted(); - } -} diff --git a/maven-plugin/src/test/java/org/apache/maven/plugin/BeanTest.java b/maven-plugin/src/test/java/org/apache/maven/plugin/BeanTest.java deleted file mode 100644 index ad39ca3013..0000000000 --- a/maven-plugin/src/test/java/org/apache/maven/plugin/BeanTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.apache.maven.plugin; - -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import junit.framework.TestCase; - -/** - * @author Jason van Zyl - * @version $Id$ - */ -public class BeanTest - extends TestCase -{ - public void testBean() - throws Exception - { - Bean bean = new Bean(); - - bean.setName( "jason" ); - - bean.setArtifactId( "artifactId" ); - - bean.setFoo( "bar" ); - - bean.execute(); - - assertTrue( bean.hasExecuted() ); - } -}