You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/02/21 00:29:30 UTC

svn commit: r746415 - in /maven/plugin-tools/trunk/maven-plugin-plugin: ./ src/it/source-encoding/ src/it/source-encoding/latin-1/ src/it/source-encoding/latin-1/src/ src/it/source-encoding/latin-1/src/main/ src/it/source-encoding/latin-1/src/main/java...

Author: bentmann
Date: Fri Feb 20 23:29:29 2009
New Revision: 746415

URL: http://svn.apache.org/viewvc?rev=746415&view=rev
Log:
[MPLUGIN-101] Allow customization of file encoding used for mojo extraction

o Added IT

Added:
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/pom.xml   (with props)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/java/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/java/test/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/java/test/MyMojo.java   (with props)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/pom.xml   (with props)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/pom.xml   (with props)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/java/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/java/test/
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/java/test/MyMojo.java   (with props)
    maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/verify.groovy   (with props)
Modified:
    maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml?rev=746415&r1=746414&r2=746415&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/pom.xml Fri Feb 20 23:29:29 2009
@@ -273,8 +273,8 @@
             <configuration>
               <debug>true</debug>
               <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
-              <preBuildHookScript>setup.bsh</preBuildHookScript>
-              <postBuildHookScript>verify.bsh</postBuildHookScript>
+              <preBuildHookScript>setup</preBuildHookScript>
+              <postBuildHookScript>verify</postBuildHookScript>
               <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
               <settingsFile>src/it/settings.xml</settingsFile>
               <goals>

Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/pom.xml?rev=746415&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/pom.xml (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/pom.xml Fri Feb 20 23:29:29 2009
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <groupId>org.apache.maven.its.plugin</groupId>
+  <artifactId>latin-1</artifactId>
+  <version>1.0</version>
+  <packaging>maven-plugin</packaging>
+
+  <name>Latin-1</name>
+  <description>
+    Test that source files using Latin-1 are properly parsed.
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/java/test/MyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/java/test/MyMojo.java?rev=746415&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/java/test/MyMojo.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/java/test/MyMojo.java Fri Feb 20 23:29:29 2009
@@ -0,0 +1,20 @@
+package test;
+
+// NOTE: This source file is by design encoded using ISO-8859-1!
+
+import org.apache.maven.plugin.AbstractMojo;
+
+/**
+ * TEST-CHARS: ÄÖÜäöüß
+ * 
+ * @goal test
+ */
+public class MyMojo
+    extends AbstractMojo
+{
+
+    public void execute()
+    {
+    }
+
+}

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/java/test/MyMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/latin-1/src/main/java/test/MyMojo.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/pom.xml?rev=746415&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/pom.xml (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/pom.xml Fri Feb 20 23:29:29 2009
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <groupId>org.apache.maven.its.plugin</groupId>
+  <artifactId>aggregator</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+
+  <name>Aggregator</name>
+  <description>
+    Test that the character encoding of source files is respected by the metadata extractor.
+  </description>
+
+  <modules>
+    <module>utf-8</module>
+    <module>latin-1</module>
+  </modules>
+</project>

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/pom.xml?rev=746415&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/pom.xml (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/pom.xml Fri Feb 20 23:29:29 2009
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <groupId>org.apache.maven.its.plugin</groupId>
+  <artifactId>utf-8</artifactId>
+  <version>1.0</version>
+  <packaging>maven-plugin</packaging>
+
+  <name>UTF-8</name>
+  <description>
+    Test that source files using UTF-8 are properly parsed.
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/java/test/MyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/java/test/MyMojo.java?rev=746415&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/java/test/MyMojo.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/java/test/MyMojo.java Fri Feb 20 23:29:29 2009
@@ -0,0 +1,20 @@
+package test;
+
+// NOTE: This source file is by design encoded using UTF-8!
+
+import org.apache.maven.plugin.AbstractMojo;
+
+/**
+ * TEST-CHARS: ßıΣЯא€
+ * 
+ * @goal test
+ */
+public class MyMojo
+    extends AbstractMojo
+{
+
+    public void execute()
+    {
+    }
+
+}

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/java/test/MyMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/utf-8/src/main/java/test/MyMojo.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/verify.groovy?rev=746415&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/verify.groovy (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/verify.groovy Fri Feb 20 23:29:29 2009
@@ -0,0 +1,13 @@
+def latin1File = new File(basedir, 'latin-1/target/classes/META-INF/maven/plugin.xml')
+assert latin1File.exists()
+def latin1Chars = new XmlParser().parse(latin1File).mojos.mojo.description.text()
+println latin1Chars
+assert "TEST-CHARS: \u00C4\u00D6\u00DC\u00E4\u00F6\u00FC\u00DF".equals( latin1Chars )
+
+def utf8File = new File(basedir, 'utf-8/target/classes/META-INF/maven/plugin.xml')
+assert utf8File.exists()
+def utf8Chars = new XmlParser().parse(utf8File).mojos.mojo.description.text()
+println utf8Chars
+assert "TEST-CHARS: \u00DF\u0131\u03A3\u042F\u05D0\u20AC".equals( utf8Chars )
+
+return true;

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/verify.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/source-encoding/verify.groovy
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision