You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2007/07/27 21:30:48 UTC

svn commit: r560359 - in /maven/shared/trunk/maven-model-converter/src: main/java/org/apache/maven/model/converter/plugins/ main/java/org/apache/maven/model/converter/relocators/ test/java/org/apache/maven/model/converter/plugins/ test/resources/

Author: dennisl
Date: Fri Jul 27 12:30:47 2007
New Revision: 560359

URL: http://svn.apache.org/viewvc?view=rev&rev=560359
Log:
o [MONE-21] Add relocators and converters for maven-javacc-plugin and maven-javancss-plugin

Added:
    maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCJavaNCSS.java   (with props)
    maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaCCPluginRelocator.java   (with props)
    maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaNCSSPluginRelocator.java   (with props)
    maven/shared/trunk/maven-model-converter/src/test/java/org/apache/maven/model/converter/plugins/PCCJavaNCSSTest.java   (with props)
    maven/shared/trunk/maven-model-converter/src/test/resources/PCCJavaNCSSTest.properties   (with props)

Added: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCJavaNCSS.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCJavaNCSS.java?view=auto&rev=560359
==============================================================================
--- maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCJavaNCSS.java (added)
+++ maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCJavaNCSS.java Fri Jul 27 12:30:47 2007
@@ -0,0 +1,56 @@
+package org.apache.maven.model.converter.plugins;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.maven.model.converter.ProjectConverterException;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+
+import java.util.Properties;
+
+/**
+ * A <code>PluginConfigurationConverter</code> for the maven-javancss-plugin.
+ *
+ * @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="javancss"
+ *
+ * @author Dennis Lundberg
+ * @version $Id$
+ */
+public class PCCJavaNCSS extends AbstractPluginConfigurationConverter
+{
+    /**
+     * @see AbstractPluginConfigurationConverter#getArtifactId()
+     */
+    public String getArtifactId()
+    {
+        return "maven-javancss-plugin";
+    }
+
+    public String getType()
+    {
+        return TYPE_REPORT_PLUGIN;
+    }
+
+    protected void buildConfiguration( Xpp3Dom configuration, org.apache.maven.model.v3_0_0.Model v3Model,
+                                       Properties projectProperties )
+        throws ProjectConverterException
+    {
+        addConfigurationChild( configuration, projectProperties, "maven.javancss.build.dir", "xmlOutputDirectory" );
+    }
+}

Propchange: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCJavaNCSS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/plugins/PCCJavaNCSS.java
------------------------------------------------------------------------------
    svn:keywords = Date Id

Added: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaCCPluginRelocator.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaCCPluginRelocator.java?view=auto&rev=560359
==============================================================================
--- maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaCCPluginRelocator.java (added)
+++ maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaCCPluginRelocator.java Fri Jul 27 12:30:47 2007
@@ -0,0 +1,55 @@
+package org.apache.maven.model.converter.relocators;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * A <code>PluginRelocator</code> for the maven-javacc-plugin.
+ *
+ * @author Dennis Lundberg
+ * @version $Id$
+ * @plexus.component role="org.apache.maven.model.converter.relocators.PluginRelocator"
+ * role-hint="javacc"
+ */
+public class JavaCCPluginRelocator extends AbstractPluginRelocator
+{
+    /**
+     * @see AbstractPluginRelocator#getNewArtifactId()
+     */
+    public String getNewArtifactId()
+    {
+        return "javacc-maven-plugin";
+    }
+
+    /**
+     * @see AbstractPluginRelocator#getNewGroupId()
+     */
+    public String getNewGroupId()
+    {
+        return "org.codehaus.mojo";
+    }
+
+    /**
+     * @see AbstractPluginRelocator#getOldArtifactId()
+     */
+    public String getOldArtifactId()
+    {
+        return "maven-javacc-plugin";
+    }
+}

Propchange: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaCCPluginRelocator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaCCPluginRelocator.java
------------------------------------------------------------------------------
    svn:keywords = Date Id

Added: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaNCSSPluginRelocator.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaNCSSPluginRelocator.java?view=auto&rev=560359
==============================================================================
--- maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaNCSSPluginRelocator.java (added)
+++ maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaNCSSPluginRelocator.java Fri Jul 27 12:30:47 2007
@@ -0,0 +1,55 @@
+package org.apache.maven.model.converter.relocators;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * A <code>PluginRelocator</code> for the maven-javancss-plugin.
+ *
+ * @author Dennis Lundberg
+ * @version $Id$
+ * @plexus.component role="org.apache.maven.model.converter.relocators.PluginRelocator"
+ * role-hint="javancss"
+ */
+public class JavaNCSSPluginRelocator extends AbstractSourceForgePluginRelocator
+{
+    /**
+     * @see AbstractPluginRelocator#getNewArtifactId()
+     */
+    public String getNewArtifactId()
+    {
+        return "javancss-maven-plugin";
+    }
+
+    /**
+     * @see AbstractPluginRelocator#getNewGroupId()
+     */
+    public String getNewGroupId()
+    {
+        return "org.codehaus.mojo";
+    }
+
+    /**
+     * @see AbstractPluginRelocator#getOldArtifactId()
+     */
+    public String getOldArtifactId()
+    {
+        return "maven-javancss-plugin";
+    }
+}

Propchange: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaNCSSPluginRelocator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/maven-model-converter/src/main/java/org/apache/maven/model/converter/relocators/JavaNCSSPluginRelocator.java
------------------------------------------------------------------------------
    svn:keywords = Date Id

Added: maven/shared/trunk/maven-model-converter/src/test/java/org/apache/maven/model/converter/plugins/PCCJavaNCSSTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-model-converter/src/test/java/org/apache/maven/model/converter/plugins/PCCJavaNCSSTest.java?view=auto&rev=560359
==============================================================================
--- maven/shared/trunk/maven-model-converter/src/test/java/org/apache/maven/model/converter/plugins/PCCJavaNCSSTest.java (added)
+++ maven/shared/trunk/maven-model-converter/src/test/java/org/apache/maven/model/converter/plugins/PCCJavaNCSSTest.java Fri Jul 27 12:30:47 2007
@@ -0,0 +1,61 @@
+package org.apache.maven.model.converter.plugins;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.Assert;
+import org.apache.maven.model.converter.ProjectConverterException;
+
+import java.io.IOException;
+
+/**
+ * @author Dennis Lundberg
+ * @version $Id$
+ */
+public class PCCJavaNCSSTest extends AbstractPCCTest
+{
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        pluginConfigurationConverter = new PCCJavaNCSS();
+    }
+
+    public void testBuildConfiguration()
+    {
+        try
+        {
+            projectProperties.load( getClassLoader().getResourceAsStream( "PCCJavaNCSSTest.properties" ) );
+
+            pluginConfigurationConverter.buildConfiguration( configuration, v3Model, projectProperties );
+
+            String value = configuration.getChild( "xmlOutputDirectory" ).getValue();
+            Assert.assertEquals( "check xmlOutputDirectory value", "target/javancss", value );
+        }
+        catch ( ProjectConverterException e )
+        {
+            Assert.fail( e.getMessage() );
+        }
+        catch ( IOException e )
+        {
+            Assert.fail( "Unable to find the requested resource." );
+        }
+    }
+}

Propchange: maven/shared/trunk/maven-model-converter/src/test/java/org/apache/maven/model/converter/plugins/PCCJavaNCSSTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/maven-model-converter/src/test/java/org/apache/maven/model/converter/plugins/PCCJavaNCSSTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Id

Added: maven/shared/trunk/maven-model-converter/src/test/resources/PCCJavaNCSSTest.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-model-converter/src/test/resources/PCCJavaNCSSTest.properties?view=auto&rev=560359
==============================================================================
--- maven/shared/trunk/maven-model-converter/src/test/resources/PCCJavaNCSSTest.properties (added)
+++ maven/shared/trunk/maven-model-converter/src/test/resources/PCCJavaNCSSTest.properties Fri Jul 27 12:30:47 2007
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+maven.javancss.build.dir=target/javancss

Propchange: maven/shared/trunk/maven-model-converter/src/test/resources/PCCJavaNCSSTest.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/maven-model-converter/src/test/resources/PCCJavaNCSSTest.properties
------------------------------------------------------------------------------
    svn:keywords = Date Id