maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r595668 - in /maven/shared/trunk/file-management/src/site: ./ apt/ apt/examples/ apt/examples/mojo.apt apt/index.apt site.xml
Date Fri, 16 Nov 2007 14:10:21 GMT
Author: vsiveton
Date: Fri Nov 16 06:10:20 2007
New Revision: 595668

URL: http://svn.apache.org/viewvc?rev=595668&view=rev
Log:
o added documentation

Added:
    maven/shared/trunk/file-management/src/site/
    maven/shared/trunk/file-management/src/site/apt/
    maven/shared/trunk/file-management/src/site/apt/examples/
    maven/shared/trunk/file-management/src/site/apt/examples/mojo.apt   (with props)
    maven/shared/trunk/file-management/src/site/apt/index.apt   (with props)
    maven/shared/trunk/file-management/src/site/site.xml   (with props)

Added: maven/shared/trunk/file-management/src/site/apt/examples/mojo.apt
URL: http://svn.apache.org/viewvc/maven/shared/trunk/file-management/src/site/apt/examples/mojo.apt?rev=595668&view=auto
==============================================================================
--- maven/shared/trunk/file-management/src/site/apt/examples/mojo.apt (added)
+++ maven/shared/trunk/file-management/src/site/apt/examples/mojo.apt Fri Nov 16 06:10:20
2007
@@ -0,0 +1,143 @@
+ ------
+ Using Maven File Management API In A MOJO
+ ------
+ Vincent Siveton
+ ------
+ November 2007
+ ------
+
+~~ 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.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Using Maven File Management API In A MOJO
+
+ This part explains how to use the Maven File Management API in a Maven Plugin.
+
+* Added File Management API dependency
+
+ The first step is to add the File Management API as a Maven dependency, i.e. in the pom.xml:
+
++-----+
+<project>
+  ...
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>file-management</artifactId>
+      <version>1.2-SNAPSHOT</version>
+    </dependency>
+    ...
+  </dependencies>
+  ...
+</project>
++-----+
+
+* Added FileSet in a MOJO
+
+ The second step is to create your MOJO and add a <<<FileSet>>> object:
+
++-----+
+/**
+ * My MOJO
+ *
+ * @goal myGoal
+ */
+public class MyMojo
+    extends AbstractMojo
+{
+    /**
+     * A list of <code>fileSet</code> rules to select files and directories.
+     *
+     * @parameter
+     */
+    private List filesets;
+
+    /**
+     * A specific <code>fileSet</code> rule to select files and directories.
+     *
+     * @parameter
+     */
+    private FileSet fileset;
+
+    ...
+}
++-----+
+
+ To use the <<<FileSet>>> object, you need to instantiate the <<<FileSetManager>>>.
+
++-----+
+FileSetManager fileSetManager = new FileSetManager();
+
+String[] includedFiles = fileSetManager.getIncludedFiles( fileset );
+String[] includedDir = fileSetManager.getIncludedDirectories( fileset );
+String[] excludedFiles = fileSetManager.getExcludedFiles( fileset );
+String[] excludedDir = fileSetManager.getExcludedDirectories( fileset );
+fileSetManager.delete( fileset );
++-----+
+
+* Configure your Maven Plugin
+
+ The last step is the Maven Plugin configuration.
+
++-----+
+<project>
+  ...
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>your-plugin-groupId</groupId>
+        <artifactId>your-plugin-artifactId</artifactId>
+        <version>your-plugin-version</version>
+        <configuration>
+          <!-- List of filesets -->
+          <filesets>
+            <fileset>
+              <directory>some/relative/path</directory>
+              <includes>
+                <include>**/*.txt</include>
+              </includes>
+              <excludes>
+                <exclude>**/log.log</exclude>
+              </excludes>
+              <followSymlinks>false</followSymlinks>
+            </fileset>
+          </filesets>
+
+          <!-- Given fileset -->
+          <fileset>
+            <directory>some/relative/path</directory>
+            <includes>
+              <include>**/*.txt</include>
+            </includes>
+            <excludes>
+              <exclude>**/log.log</exclude>
+            </excludes>
+            <followSymlinks>false</followSymlinks>
+          </fileset>
+
+          ...
+        </configuration>
+      </plugin>
+      ...
+    </plugins>
+  </build>
+  ...
+</project>
++-----+

Propchange: maven/shared/trunk/file-management/src/site/apt/examples/mojo.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/file-management/src/site/apt/examples/mojo.apt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/shared/trunk/file-management/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/shared/trunk/file-management/src/site/apt/index.apt?rev=595668&view=auto
==============================================================================
--- maven/shared/trunk/file-management/src/site/apt/index.apt (added)
+++ maven/shared/trunk/file-management/src/site/apt/index.apt Fri Nov 16 06:10:20 2007
@@ -0,0 +1,46 @@
+ ------
+ Maven File Management API
+ ------
+ Vincent Siveton
+ ------
+ November 2007
+ ------
+
+~~ 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.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Overview
+
+  The Maven File Management API provides an API to collect files from a given directory using
+  several include/exclude rules.
+
+* Brief History
+
+ This original code is based on the <<<org.apache.tools.ant.util>>> package
from the {{{http://ant.apache.org/}Ant}}
+ build tool.
+
+* Examples
+
+  To provide you with better understanding on some usages of this API,
+  you can take a look into the following examples:
+
+  * {{{examples/mojo.html}Using the API in a Maven Plugin}}
+
+  []

Propchange: maven/shared/trunk/file-management/src/site/apt/index.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/file-management/src/site/apt/index.apt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/shared/trunk/file-management/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/file-management/src/site/site.xml?rev=595668&view=auto
==============================================================================
--- maven/shared/trunk/file-management/src/site/site.xml (added)
+++ maven/shared/trunk/file-management/src/site/site.xml Fri Nov 16 06:10:20 2007
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+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>
+  <bannerLeft>
+    <name>${project.name}</name>
+    <src>http://maven.apache.org/images/apache-maven-project-2.png</src>
+    <href>http://maven.apache.org/plugins/maven-jxr-plugin/</href>
+  </bannerLeft>
+
+  <bannerRight>
+    <src>http://maven.apache.org/images/maven-logo-2.gif</src>
+  </bannerRight>
+
+  <skin>
+    <groupId>org.apache.maven.skins</groupId>
+    <artifactId>maven-stylus-skin</artifactId>
+  </skin>
+
+  <publishDate format="dd MMM yyyy" />
+  <version position="left" />
+
+  <body>
+    <links>
+      <item name="Apache" href="http://www.apache.org/"/>
+      <item name="Maven 1.x" href="http://maven.apache.org/maven-1.x"/>
+      <item name="Maven 2.x" href="http://maven.apache.org/"/>
+      <item name="Maven 2.x Plugins" href="http://maven.apache.org/plugins/"/>
+      <item name="Continuum" href="http://maven.apache.org/continuum"/>
+      <item name="SCM" href="http://maven.apache.org/scm"/>
+      <item name="Wagon" href="http://maven.apache.org/wagon"/>
+      <item name="JXR" href="http://maven.apache.org/jxr"/>
+      <item name="Doxia" href="http://maven.apache.org/doxia"/>
+    </links>
+
+    <head>
+      <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+      </script>
+      <script type="text/javascript">
+        _uacct = "UA-140879-1";
+        urchinTracker();
+      </script>
+    </head>
+
+    <menu name="Overview">
+      <item name="Introduction" href="index.html"/>
+    </menu>
+
+    <menu name="Examples">
+      <item name="In a MOJO" href="examples/mojo.html"/>
+    </menu>
+
+    <menu ref="reports"/>
+  </body>
+</project>

Propchange: maven/shared/trunk/file-management/src/site/site.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/file-management/src/site/site.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message