Author: apetrelli
Date: Sun Feb 28 14:01:04 2010
New Revision: 917180

URL: http://svn.apache.org/viewvc?rev=917180&view=rev
Log:
TILESSB-25
Added Maven plugin for Autotag.

Added:
    tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/   (with props)
    tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/pom.xml   (with 
props)
    tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/
    tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/
    tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/
    tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/
    
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/
    
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/
    
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/autotag/
    
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/autotag/plugin/
    
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/autotag/plugin/MyMojo.java
   (with props)
Modified:
    tiles/sandbox/trunk/tiles-autotag/pom.xml

Propchange: tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Feb 28 14:01:04 2010
@@ -0,0 +1,2 @@
+.*
+target

Added: tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/pom.xml?rev=917180&view=auto
==============================================================================
--- tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/pom.xml (added)
+++ tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/pom.xml Sun Feb 28 
14:01:04 2010
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd"; 
xmlns="http://maven.apache.org/POM/4.0.0";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>tiles-autotag</artifactId>
+    <groupId>org.apache.tiles</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.tiles.autotag.plugin</groupId>
+  <artifactId>maven-autotag-plugin</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>maven-plugin</packaging>
+  <name>maven-autotag-plugin Maven Mojo</name>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: 
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/autotag/plugin/MyMojo.java
URL: 
http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/autotag/plugin/MyMojo.java?rev=917180&view=auto
==============================================================================
--- 
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/autotag/plugin/MyMojo.java
 (added)
+++ 
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/autotag/plugin/MyMojo.java
 Sun Feb 28 14:01:04 2010
@@ -0,0 +1,81 @@
+package org.apache.tiles.autotag.plugin;
+
+/*
+ * Copyright 2001-2005 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 java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * Goal which touches a timestamp file.
+ *
+ * @goal touch
+ * 
+ * @phase process-sources
+ */
+public class MyMojo
+    extends AbstractMojo
+{
+    /**
+     * Location of the file.
+     * @parameter expression="${project.build.directory}"
+     * @required
+     */
+    private File outputDirectory;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        File f = outputDirectory;
+
+        if ( !f.exists() )
+        {
+            f.mkdirs();
+        }
+
+        File touch = new File( f, "touch.txt" );
+
+        FileWriter w = null;
+        try
+        {
+            w = new FileWriter( touch );
+
+            w.write( "touch.txt" );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "Error creating file " + touch, 
e );
+        }
+        finally
+        {
+            if ( w != null )
+            {
+                try
+                {
+                    w.close();
+                }
+                catch ( IOException e )
+                {
+                    // ignore
+                }
+            }
+        }
+    }
+}

Propchange: 
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/autotag/plugin/MyMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tiles/sandbox/trunk/tiles-autotag/maven-autotag-plugin/src/main/java/org/apache/tiles/autotag/plugin/MyMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/sandbox/trunk/tiles-autotag/pom.xml
URL: 
http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-autotag/pom.xml?rev=917180&r1=917179&r2=917180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-autotag/pom.xml (original)
+++ tiles/sandbox/trunk/tiles-autotag/pom.xml Sun Feb 28 14:01:04 2010
@@ -1,5 +1,5 @@
-<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";>
+<?xml version="1.0" encoding="UTF-8"?>
+<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";>
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <artifactId>tiles-master</artifactId>
@@ -16,7 +16,8 @@
         <module>tiles-autotag-core-runtime</module>
         <module>tiles-autotag-core</module>
         <module>tiles-autotag-jsp</module>
-    </modules>
+    <module>maven-autotag-plugin</module>
+  </modules>
     <build>
         <pluginManagement>
             <plugins>
@@ -31,4 +32,4 @@
             </plugins>
         </pluginManagement>
     </build>
-</project>
+</project>
\ No newline at end of file


Reply via email to