Permalink
Browse files

pushed an broken build

  • Loading branch information...
1 parent bc18ccc commit cd4685f7d61ba4448b82bfbd857bf0602f76a070 @sirrapa committed Dec 10, 2012
View
@@ -0,0 +1,6 @@
+*.class
+*.jar
+.iml
+.idea/
+.DS_Store
+target/
View
143 pom.xml
@@ -1,14 +1,21 @@
-<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">
+<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>
- <groupId>com.afklm.maven.pom</groupId>
- <artifactId>afklm-plugins-pom</artifactId>
- <version>3.2.0-RC1-SNAPSHOT</version>
+ <artifactId>maven-plugins</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <version>23</version>
</parent>
- <groupId>com.afklm.maven.plugins</groupId>
+ <groupId>com.sirrapa.maven.plugins</groupId>
<artifactId>nodejs-maven-plugin</artifactId>
<name>nodejs-maven-plugin</name>
+ <version>0.8.15-001-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
+ <properties>
+ <mavenVersion>2.2.1</mavenVersion>
+ <mavenPluginVersion>2.2.1</mavenPluginVersion>
+ <nodejs.version>0.8.15</nodejs.version>
+ </properties>
<profiles>
<profile>
<id>windows</id>
@@ -69,21 +76,18 @@
<filtering>true</filtering>
</testResource>
</testResources>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <configuration>
- <escapeString>\</escapeString>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <configuration>
+ <escapeString>\</escapeString>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
+ <version>1.8</version>
<configuration>
<!-- NOTE: Must be synced with the repo path used by NodeJsPluginIT -->
<localRepositoryPath>${localRepositoryPath}</localRepositoryPath>
@@ -106,7 +110,7 @@
<include>**/*IT.java</include>
</includes>
<systemPropertyVariables combine.children="append">
- <maven.home>${maven.home}</maven.home>
+ <!--<maven.home>${maven.home}</maven.home>-->
<userlocalRepository>${settings.localRepository}</userlocalRepository>
<localRepositoryPath>${localRepositoryPath}</localRepositoryPath>
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
@@ -120,99 +124,62 @@
</build>
</profile>
</profiles>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <configuration>
- <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
- <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
- </configuration>
- <executions>
- <execution>
- <id>mojo-descriptor</id>
- <goals>
- <goal>descriptor</goal>
- </goals>
- </execution>
- <!-- if you want to generate help goal -->
- <execution>
- <id>help-goal</id>
- <goals>
- <goal>helpmojo</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <!--<version>2.6</version>-->
- <executions>
- <execution>
- <id>src-dependencies</id>
- <phase>generate-resources</phase>
- <goals>
- <!-- use copy-dependencies instead if you don't want to explode the sources -->
- <goal>unpack-dependencies</goal>
- </goals>
- <configuration>
- <includeArtifactIds>nodejs</includeArtifactIds>
- <outputDirectory>${project.build.outputDirectory}/nodejs</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
<dependencies>
<dependency>
<groupId>org.nodejs</groupId>
<artifactId>nodejs</artifactId>
- <version>0.8.15</version>
+ <version>${nodejs.version}</version>
<classifier>${envClassifier}</classifier>
<type>tar</type>
</dependency>
<dependency>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.6</version>
+ <groupId>org.apache.maven.plugin-testing</groupId>
+ <artifactId>maven-plugin-testing-harness</artifactId>
+ <version>1.2</version>
</dependency>
<dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- </dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>${mavenVersion}</version>
+ </dependency>
<dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- </dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <version>${mavenVersion}</version>
+ </dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-verifier</artifactId>
- </dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-descriptor</artifactId>
+ <version>${mavenVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>${mavenVersion}</version>
+ </dependency>
<dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-annotations</artifactId>
- <scope>provided</scope>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.6</version>
</dependency>
<dependency>
- <groupId>org.apache.maven.plugin-testing</groupId>
- <artifactId>maven-plugin-testing-harness</artifactId>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-verifier</artifactId>
+ <version>1.3</version>
</dependency>
</dependencies>
<developers>
<developer>
- <id>ex4x6</id>
- <name>Parris, A - SPLXL</name>
- <email>armand.parris@klm.com</email>
- <url>http://confluence.eden.klm.com/display/~x082085</url>
- <organization>KLM</organization>
- <organizationUrl>http://confluence.eden.klm.com/display/KLCCWD/Home</organizationUrl>
+ <id>aparris</id>
+ <name>Armand Parris</name>
+ <email>armand.parris@sirrapa.com</email>
+ <url>http://www.sirrapa.com/display/~aparris</url>
+ <organization>Sirrapa Software Integration</organization>
+ <organizationUrl>http://www.sirrapa.com</organizationUrl>
<roles>
<role>developer</role>
</roles>
<timezone>+1</timezone>
</developer>
-</developers>
+ </developers>
</project>
@@ -4,21 +4,14 @@
import java.util.ArrayList;
import java.util.List;
+import com.afklm.maven.nodejs.config.NodeJsModule;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.dependency.AbstractFromDependenciesMojo;
import org.apache.maven.plugin.dependency.utils.DependencyStatusSets;
import org.apache.maven.plugin.dependency.utils.DependencyUtil;
-import org.apache.maven.plugin.dependency.utils.filters.MarkerFileFilter;
import org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter;
import org.codehaus.plexus.configuration.PlexusConfiguration;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
@@ -27,23 +20,25 @@
import org.codehaus.plexus.util.cli.Commandline;
import org.codehaus.plexus.util.cli.StreamConsumer;
-import com.afklm.maven.nodejs.config.NodeJsModule;
-
/**
* Goal which runs Nodejs.
+ * @goal nodejs
+ * @phase generate-resource
*/
-@Mojo(name = "nodejs", defaultPhase = LifecyclePhase.PROCESS_SOURCES, threadSafe = true, requiresDependencyResolution = ResolutionScope.RUNTIME)
public class NodeJsMojo extends AbstractFromDependenciesMojo {
/**
+ * @parameter property="project"
+ * @required
+ * @readonly
*/
- @Component
private MavenProject project;
/**
* The nodejs file to run
+ * @parameter
+ * @required
*/
- @Parameter(required = true)
private PlexusConfiguration modules;
private NodeJsModule[] nodeJsModules;
@@ -57,7 +52,18 @@ public void execute() throws MojoExecutionException {
unpackNodeJs();
- // create a commandline and set the executable to nodejs
+ executeNodeJs();
+ }
+ catch (CommandLineException e) {
+ throw new MojoExecutionException("Command execution failed.", e);
+ }
+ catch (NodeJsPluginException e) {
+ throw new MojoExecutionException("", e);
+ }
+ }
+
+ protected void executeNodeJs() throws MojoExecutionException, CommandLineException {
+ // create a commandline and set the executable to nodejs
Commandline commandLine = new Commandline();
commandLine.setExecutable("nodejs"); //TODO determine executable by OS
// commandLine.setWorkingDirectory(script.getParent());
@@ -74,19 +80,13 @@ public void consumeLine(String line) {
moduleArg.setValue(module.getName());
commandLine.addArg(moduleArg, true);
commandLine.addArguments(module.getArguments());
- }
- int result = executeCommandLine(commandLine, consumer, consumer);
- if (result != 0) {
- throw new MojoExecutionException("Result of " + commandLine + " execution is: '" + result + "'.");
+ int result = executeCommandLine(commandLine, consumer, consumer);
+
+ if (result != 0) {
+ throw new MojoExecutionException("Result of " + commandLine + " execution is: '" + result + "'.");
+ }
}
- }
- catch (CommandLineException e) {
- throw new MojoExecutionException("Command execution failed.", e);
- }
- catch (NodeJsPluginException e) {
- throw new MojoExecutionException("", e);
- }
}
protected void unpackNodeJs() throws MojoExecutionException {
@@ -127,7 +127,7 @@ protected int executeCommandLine(Commandline commandLine, StreamConsumer stream1
*
* @throws NodeJsPluginException if the configuration is invalid
*/
- private void initializeModulesConfiguration()
+ protected void initializeModulesConfiguration()
throws NodeJsPluginException {
if (modules == null) {
throw new NodeJsPluginException("No NodeJs modules configured.");
Oops, something went wrong.

0 comments on commit cd4685f

Please sign in to comment.