maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r494831 - in /maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/maven/ src/main/java/o...
Date Wed, 10 Jan 2007 14:48:02 GMT
Author: jvanzyl
Date: Wed Jan 10 06:48:01 2007
New Revision: 494831

URL: http://svn.apache.org/viewvc?view=rev&rev=494831
Log:
o a IT plugin that takes a configuration section which is a DOM and emits the fully interpolated
configuration for inspection.

Added:
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/pom.xml
  (with props)
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/
    maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
  (with props)

Added: maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/pom.xml?view=auto&rev=494831
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/pom.xml
(added)
+++ maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/pom.xml
Wed Jan 10 06:48:01 2007
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ Copyright 2005-2006 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>maven-it-plugins</artifactId>
+    <groupId>org.apache.maven.its.plugins</groupId>
+    <version>1-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>maven-it-plugin-configuration</artifactId>
+  <packaging>maven-plugin</packaging>
+  <name>Maven Integration Test Plugin :: Configuration</name>
+  <description>
+    A plugin that allows any configuration in the form of a DOM which allows inspection after
+    configuration processing inside Maven's core.
+  </description>
+  <version>1.0-SNAPSHOT</version>
+  <inceptionYear>2001</inceptionYear>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <version>1.0-alpha-9</version>
+    </dependency>    
+  </dependencies>
+</project>
+

Propchange: maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java?view=auto&rev=494831
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
(added)
+++ maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
Wed Jan 10 06:48:01 2007
@@ -0,0 +1,72 @@
+package org.apache.maven.plugin.coreit;
+
+/*
+ * 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 org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.codehaus.plexus.util.xml.Xpp3DomWriter;
+import org.codehaus.plexus.configuration.PlexusConfiguration;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+//MAPI: This is a canidate for the internal state dump (ISD). This is probably similar to
what is in the help plugin.
+
+/**
+ * @goal config
+ * @phase generate-resources
+ * @description Goal produces a raw string with contains full interpolated plugin configurations.
+ */
+public class CoreItMojo
+    extends AbstractMojo
+{
+    /** @parameter expression="${dom}" */
+    private PlexusConfiguration dom;
+
+    /** @parameter expression="${outputDirectory}" default-value="${project.build.directory}"
*/
+    private File outputDirectory;
+
+    /** @parameter expression="${fileName}" default-value="plugin-configuration.txt" */
+    private String fileName;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        try
+        {
+            File file = new File( outputDirectory, fileName );
+
+            if ( !outputDirectory.exists() )
+            {
+                outputDirectory.mkdirs();
+            }
+
+            Writer writer = new FileWriter( file );
+
+            writer.write( dom.toString() );
+
+            writer.close();
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "Error writing out plugin configuration.",
e );
+        }
+    }
+}

Propchange: maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-integration-testing-plugins/maven-it-plugin-configuration/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message