Skip to content
Permalink
Browse files
Add m2e lifecyle stuff
git-svn-id: https://svn.apache.org/repos/asf/cxf/build-utils/trunk@1405983 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
dkulp committed Nov 5, 2012
1 parent 5b6280a commit b9fca6cfde840bd2db35b62ac43080a1875183ef
Showing 6 changed files with 44 additions and 16 deletions.
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.cxf.build-utils</groupId>
<artifactId>cxf-build-utils</artifactId>
<version>2.4.2-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
@@ -68,14 +68,14 @@
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.3.2</version>
<version>2.0</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>pmd</groupId>
<artifactId>pmd</artifactId>
<version>4.2</version>
<version>4.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
@@ -26,7 +26,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.cxf.build-utils</groupId>
<artifactId>cxf-build-utils</artifactId>
<version>2.4.2-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
<name>Apache CXF Build Utilities</name>
<url>http://cxf.apache.org</url>
<packaging>pom</packaging>
@@ -175,7 +175,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<version>2.4</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
@@ -21,12 +21,11 @@
<parent>
<groupId>org.apache.cxf.build-utils</groupId>
<artifactId>cxf-build-utils</artifactId>
<version>2.4.2-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>


<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.cxf.build-utils</groupId>
<artifactId>cxf-xml2fastinfoset-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Apache CXF XML to FastInfoset Maven2 Plugin</name>
@@ -50,7 +49,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -59,6 +58,13 @@
<version>2.0.9</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
<version>0.0.7</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
@@ -74,12 +80,12 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.0.4</version>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>com.sun.xml.fastinfoset</groupId>
<artifactId>FastInfoset</artifactId>
<version>1.2.7</version>
<version>1.2.12</version>
</dependency>
</dependencies>
</project>
@@ -35,6 +35,7 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.sonatype.plexus.build.incremental.BuildContext;
import org.xml.sax.SAXException;

import com.sun.xml.fastinfoset.sax.SAXDocumentSerializer;
@@ -44,6 +45,7 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.Scanner;

/**
* Compile XML resources to FastInfoset XML resources.
@@ -93,6 +95,10 @@ public class XML2FastInfosetCompilerMojo extends AbstractMojo {
* @required
*/
private File outputDirectory;

/** @component */
protected BuildContext buildContext;


@SuppressWarnings("unchecked")
public void execute() throws MojoExecutionException {
@@ -111,10 +117,8 @@ public void execute() throws MojoExecutionException {
continue;
}

Scanner scanner = buildContext.newScanner(resourceDirectory);

DirectoryScanner scanner = new DirectoryScanner();

scanner.setBasedir(resourceDirectory);
if (includes != null && !includes.isEmpty()) {
scanner.setIncludes((String[])includes.toArray(EMPTY_STRING_ARRAY));
} else {
@@ -166,6 +170,7 @@ public void execute() throws MojoExecutionException {
} catch (Exception e) {
throw new MojoExecutionException("Error copying resource " + source, e);
}
buildContext.refresh(destinationFile);
}

}
@@ -0,0 +1,17 @@
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<goals>
<goal>xml2fastinfoset</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
<runOnConfiguration>true</runOnConfiguration>
</execute>
</action>
</pluginExecution>
</lifecycleMappingMetadata>

@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.cxf.build-utils</groupId>
<artifactId>cxf-build-utils</artifactId>
<version>2.4.2-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
@@ -37,7 +37,7 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.4</version>
<version>4.11-beta-1</version>
</dependency>
</dependencies>
<build>
@@ -57,4 +57,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

0 comments on commit b9fca6c

Please sign in to comment.