Skip to content
Commits on Source (12)
......@@ -7,7 +7,7 @@ language: java
# - '3.5.0'
jdk:
- oraclejdk7
- openjdk8
# cache local Maven repo: http://docs.travis-ci.com/user/caching/
cache:
......@@ -26,4 +26,11 @@ env:
- MAVEN=$PWD/apache-maven-3.5.0
install: /bin/true
script: export M2_HOME=$MAVEN ; export PATH=$M2_HOME/bin:$PATH ; mvn --version ; mvn clean install
script:
- echo $JAVA_HOME
- export M2_HOME=$MAVEN
- export PATH=$M2_HOME/bin:$PATH
- mvn --version
- mvn clean install
after_success: bash <(curl -s https://codecov.io/bash)
......@@ -2,10 +2,14 @@
The Mojo Executor provides a way to to execute other Mojos (plugins) within a Maven plugin, allowing you to easily create Maven plugins that are composed of other plugins.
Note from the Maintainer
========================
Note from the Maintainers
=========================
I'm no longer maintaning this project actively, as I no longer use it (and have moved away from Maven and Java entirely). It's a simple library that does its job, and a lot of people are using it effectively in its current state.
Tim Moore
---------
I'm no longer maintaining this project actively, as I no longer use it (and have moved away from Maven and Java entirely). It's a simple library that does its job, and a lot of people are using it effectively in its current state.
I am happy to continue reviewing and merging pull requests, and releasing new versions to Maven Central. Most of the contributions so far have come from other people, and I'm very grateful to the people that have helped to improve Mojo Executor.
......@@ -16,9 +20,21 @@ If anyone in the community would like to take over as full-time maintainer, let'
Cheers,
&mdash; Tim
Nick Cross
----------
While I am no longer actively using this plugin I am happy to review, assist with contributions, merge PRs and release new versions. I have released the last two versions (2.3.0/2.3.1) rolling up all the various fixes and improvements.
Cheers,
&mdash; Nick
News
====
- 4 May 2017 &mdash; Mojo Executor 2.3.0 released (by Nick Cross) with various bug fixes and minor improvements.
- 27 Mar 2014 &mdash; Mojo Executor 1.5.2 released with support for Maven 2 through 3.1.
- 12 Feb 2014 &mdash; I'm looking for a new maintainer for this project. If you're interested, please get in touch!
- 26 Nov 2013 &mdash; Mojo Executor 2.2.0 released with support for attributes in plugin configuration.
......@@ -97,7 +113,7 @@ Add this to your pom.xml:
<dependency>
<groupId>org.twdata.maven</groupId>
<artifactId>mojo-executor</artifactId>
<version>2.2.0</version>
<version>2.3.0</version>
</dependency>
</dependencies>
```
......
mojo-executor (2.3.1-1) unstable; urgency=medium
* New upstream version 2.3.1
* Ignoring tests.
* Updating my e-mail.
* Wrapping and sorting.
* Bumping debhelper compat level (no changes).
-- Andrius Merkys <merkys@debian.org> Mon, 25 Nov 2019 06:18:50 -0500
mojo-executor (2.3.0-1) unstable; urgency=medium
* Initial release (Closes: #911286)
......
......@@ -2,20 +2,18 @@ Source: mojo-executor
Section: java
Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Uploaders: Andrius Merkys <andrius.merkys@gmail.com>
Uploaders:
Andrius Merkys <merkys@debian.org>,
Build-Depends:
debhelper (>= 11),
debhelper (>= 12),
default-jdk,
junit4 (>= 4.12),
libcommons-lang-java (>= 2.5),
libhamcrest-java,
libmaven-invoker-plugin-java,
libmaven-plugin-tools-java (>= 3.5),
libmaven3-core-java,
libmockito-java,
libplexus-utils2-java (>= 2.1),
libslf4j-java (>= 1.7.22),
maven-debian-helper (>= 2.1)
maven-debian-helper (>= 2.1),
Standards-Version: 4.2.1
Vcs-Git: https://salsa.debian.org/java-team/mojo-executor.git
Vcs-Browser: https://salsa.debian.org/java-team/mojo-executor
......@@ -23,8 +21,11 @@ Homepage: https://timmoore.github.com/mojo-executor/
Package: libmojo-executor-java
Architecture: all
Depends: ${maven:Depends}, ${misc:Depends}
Suggests: ${maven:OptionalDepends}
Depends:
${maven:Depends},
${misc:Depends},
Suggests:
${maven:OptionalDepends},
Description: Maven Mojo Executor
The Mojo Executor provides a way to execute other Mojos (plugins) within a
Maven plugin, allowing one to easily create Maven plugins that are composed
......
......@@ -11,7 +11,7 @@ Copyright: 2008-2009, Don Brown <mrdon@twdata.org>
License: Apache-2.0
Files: debian/*
Copyright: 2018, Andrius Merkys <andrius.merkys@gmail.com>
Copyright: 2018-2019, Andrius Merkys <merkys@debian.org>
License: Apache-2.0
License: Apache-2.0
......
org.apache.maven.plugins maven-enforcer-plugin * * * *
org.apache.maven.plugins maven-release-plugin * * * *
org.jacoco jacoco-maven-plugin * * * *
org.mockito mockito-core * * * *
......@@ -3,3 +3,4 @@
# maven.test.skip=true
# project.build.sourceEncoding=UTF-8
maven.test.skip=true
sonatype-to-eclipse.patch
--- a/mojo-executor/src/main/java/org/twdata/maven/mojoexecutor/MavenCompatibilityHelper.java
+++ b/mojo-executor/src/main/java/org/twdata/maven/mojoexecutor/MavenCompatibilityHelper.java
@@ -26,7 +26,7 @@
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.sonatype.aether.repository.RemoteRepository;
+import org.eclipse.aether.repository.RemoteRepository;
import org.twdata.maven.mojoexecutor.MojoExecutor.ExecutionEnvironment;
import java.lang.reflect.InvocationTargetException;
--- a/mojo-executor/src/test/java/org/twdata/maven/mojoexecutor/MojoExecutorTest.java
+++ b/mojo-executor/src/test/java/org/twdata/maven/mojoexecutor/MojoExecutorTest.java
@@ -34,8 +34,8 @@
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.repository.RemoteRepository;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.repository.RemoteRepository;
import java.util.List;
import java.util.Map;
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.twdata.maven</groupId>
<artifactId>mojo-executor-parent</artifactId>
<version>2.3.0</version>
<version>2.3.1</version>
</parent>
<artifactId>mojo-executor-maven-plugin</artifactId>
......@@ -80,7 +80,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.4</version>
<executions>
<execution>
<id>default-descriptor</id>
......@@ -94,7 +93,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<!-- <debug>true</debug> -->
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
......
......@@ -41,6 +41,7 @@ import static org.twdata.maven.mojoexecutor.PlexusConfigurationUtils.toXpp3Dom;
/**
* Execute a Mojo using the MojoExecutor.
*/
@SuppressWarnings("unused")
@Mojo( name = "execute-mojo", defaultPhase = LifecyclePhase.TEST, requiresDependencyResolution = ResolutionScope.TEST)
public class MojoExecutorMojo extends AbstractMojo {
/**
......
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.twdata.maven</groupId>
<artifactId>mojo-executor-parent</artifactId>
<version>2.3.0</version>
<version>2.3.1</version>
</parent>
<artifactId>mojo-executor</artifactId>
......@@ -66,6 +66,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
......@@ -24,9 +24,9 @@ import org.apache.maven.plugin.PluginDescriptorParsingException;
import org.apache.maven.plugin.PluginNotFoundException;
import org.apache.maven.plugin.PluginResolutionException;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.eclipse.aether.repository.RemoteRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonatype.aether.repository.RemoteRepository;
import org.twdata.maven.mojoexecutor.MojoExecutor.ExecutionEnvironment;
import java.lang.reflect.InvocationTargetException;
......
......@@ -65,6 +65,7 @@ import static org.twdata.maven.mojoexecutor.PlexusConfigurationUtils.toXpp3Dom;
* );
* </pre>
*/
@SuppressWarnings("WeakerAccess")
public class MojoExecutor {
private static final Logger logger = LoggerFactory.getLogger( MojoExecutor.class );
......@@ -117,20 +118,7 @@ public class MojoExecutor {
}
MojoExecution exec = mojoExecution(mojoDescriptor, executionId, configuration);
env.getPluginManager().executeMojo(session, exec);
// TODO : Consider using JDK7 multi-catch
} catch (PluginConfigurationException e) {
throw new MojoExecutionException("Unable to execute mojo", e);
} catch (PluginNotFoundException e) {
throw new MojoExecutionException("Unable to execute mojo", e);
} catch (InvalidPluginDescriptorException e) {
throw new MojoExecutionException("Unable to execute mojo", e);
} catch (PluginManagerException e) {
throw new MojoExecutionException("Unable to execute mojo", e);
} catch (PluginDescriptorParsingException e) {
throw new MojoExecutionException("Unable to execute mojo", e);
} catch (MojoFailureException e) {
throw new MojoExecutionException("Unable to execute mojo", e);
} catch (PluginResolutionException e) {
} catch (PluginConfigurationException | PluginNotFoundException | InvalidPluginDescriptorException | PluginManagerException | PluginDescriptorParsingException | MojoFailureException | PluginResolutionException e) {
throw new MojoExecutionException("Unable to execute mojo", e);
}
}
......@@ -209,7 +197,7 @@ public class MojoExecutor {
* @return The plugin instance
*/
public static Plugin plugin(String groupId, String artifactId, String version) {
return plugin(groupId, artifactId, version, Collections.<Dependency>emptyList());
return plugin(groupId, artifactId, version, Collections.emptyList());
}
/**
......
......@@ -24,18 +24,17 @@ import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.repository.RemoteRepository;
import org.hamcrest.CoreMatchers;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeDiagnosingMatcher;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.sonatype.aether.RepositorySystemSession;
import org.sonatype.aether.repository.RemoteRepository;
import java.util.List;
import java.util.Map;
......@@ -49,6 +48,8 @@ import static org.mockito.Matchers.same;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.twdata.maven.mojoexecutor.MojoExecutor.artifactId;
import static org.twdata.maven.mojoexecutor.MojoExecutor.attribute;
import static org.twdata.maven.mojoexecutor.MojoExecutor.attributes;
import static org.twdata.maven.mojoexecutor.MojoExecutor.configuration;
import static org.twdata.maven.mojoexecutor.MojoExecutor.dependencies;
import static org.twdata.maven.mojoexecutor.MojoExecutor.dependency;
......@@ -60,8 +61,6 @@ import static org.twdata.maven.mojoexecutor.MojoExecutor.groupId;
import static org.twdata.maven.mojoexecutor.MojoExecutor.name;
import static org.twdata.maven.mojoexecutor.MojoExecutor.plugin;
import static org.twdata.maven.mojoexecutor.MojoExecutor.version;
import static org.twdata.maven.mojoexecutor.MojoExecutor.attributes;
import static org.twdata.maven.mojoexecutor.MojoExecutor.attribute;
@RunWith(MockitoJUnitRunner.class)
public class MojoExecutorTest {
......
......@@ -20,12 +20,12 @@
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
<version>9</version>
</parent>
<groupId>org.twdata.maven</groupId>
<artifactId>mojo-executor-parent</artifactId>
<version>2.3.0</version>
<version>2.3.1</version>
<packaging>pom</packaging>
<name>Mojo Executor Parent</name>
......@@ -96,6 +96,7 @@
<connection>scm:git:git://github.com/TimMoore/mojo-executor.git</connection>
<developerConnection>scm:git:ssh://git@github.com/TimMoore/mojo-executor.git</developerConnection>
<url>https://github.com/TimMoore/mojo-executor</url>
<tag>mojo-executor-parent-2.3.1</tag>
</scm>
<issueManagement>
<system>GitHub</system>
......@@ -104,7 +105,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.version>3.0.5</maven.version>
<maven.version>3.5.0</maven.version>
</properties>
<dependencyManagement>
......@@ -151,7 +152,7 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.2</version>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
......@@ -168,12 +169,12 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.22</version>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.22</version>
<version>1.7.25</version>
</dependency>
</dependencies>
</dependencyManagement>
......@@ -182,25 +183,75 @@
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven</groupId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.8.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven</groupId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>2.0.0</version>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<detectOfflineLinks>false</detectOfflineLinks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-dependencies</id>
......@@ -220,12 +271,30 @@
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
<version>2.5.3</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<mavenExecutorId>forked-path</mavenExecutorId>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
......@@ -242,7 +311,7 @@
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.2</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
......