From 97430ff492031774e1520391309333946bc4aa97 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Tue, 18 Sep 2018 16:25:08 +0200 Subject: [PATCH] Enabled tests, package ported to Maven 3 --- exec-maven-plugin-1.6.0-Port-to-Maven-3.patch | 56 +++++++++++++++++++ exec-maven-plugin.spec | 34 ++++++++--- 2 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 exec-maven-plugin-1.6.0-Port-to-Maven-3.patch diff --git a/exec-maven-plugin-1.6.0-Port-to-Maven-3.patch b/exec-maven-plugin-1.6.0-Port-to-Maven-3.patch new file mode 100644 index 0000000..4732574 --- /dev/null +++ b/exec-maven-plugin-1.6.0-Port-to-Maven-3.patch @@ -0,0 +1,56 @@ +From 53f761ccbe3411dbbe430d3af93ad4502d09fe10 Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Thu, 20 Sep 2018 15:28:48 +0200 +Subject: [PATCH] Port to Maven 3 + +--- + src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java | 4 ++-- + src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java | 2 +- + src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java b/src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java +index 4746aa2..f9a93ad 100644 +--- a/src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java ++++ b/src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java +@@ -704,9 +704,9 @@ public class ExecJavaMojo + // resolve all dependencies transitively to obtain a comprehensive list of assemblies + ArtifactResolutionResult result = + artifactResolver.resolveTransitively( dependencyArtifacts, executablePomArtifact, +- Collections.emptyMap(), this.localRepository, ++ (java.util.Map) Collections.emptyMap(), this.localRepository, + this.remoteRepositories, metadataSource, null, +- Collections.emptyList() ); ++ (java.util.List) Collections.emptyList() ); + executableDependencies = result.getArtifacts(); + } + catch ( Exception ex ) +diff --git a/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java b/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java +index 0e5afbb..4894bb3 100644 +--- a/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java ++++ b/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java +@@ -277,7 +277,7 @@ public class ExecJavaMojoTest + private void setUpProject( File pomFile, AbstractMojo mojo ) + throws Exception + { +- MavenProjectBuilder builder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE ); ++ MavenProjectBuilder builder = (MavenProjectBuilder) lookup( MavenProjectBuilder.class ); + + ArtifactRepositoryLayout localRepositoryLayout = + (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" ); +diff --git a/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java b/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java +index 2821954..29c274c 100644 +--- a/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java ++++ b/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java +@@ -233,7 +233,7 @@ public class ExecMojoTest + private void setUpProject( File pomFile, ExecMojo mojo ) + throws Exception + { +- MavenProjectBuilder builder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE ); ++ MavenProjectBuilder builder = (MavenProjectBuilder) lookup( MavenProjectBuilder.class ); + + ArtifactRepositoryLayout localRepositoryLayout = + (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" ); +-- +2.17.1 + diff --git a/exec-maven-plugin.spec b/exec-maven-plugin.spec index 8d504e6..84de10a 100644 --- a/exec-maven-plugin.spec +++ b/exec-maven-plugin.spec @@ -1,27 +1,31 @@ Name: exec-maven-plugin Version: 1.6.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Exec Maven Plugin License: ASL 2.0 -URL: http://mojo.codehaus.org/exec-maven-plugin +URL: http://www.mojohaus.org/exec-maven-plugin/ Source0: http://repo1.maven.org/maven2/org/codehaus/mojo/exec-maven-plugin/%{version}/exec-maven-plugin-%{version}-source-release.zip + +Patch1: exec-maven-plugin-1.6.0-Port-to-Maven-3.patch + BuildArch: noarch BuildRequires: maven-local +BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.apache.commons:commons-exec) -BuildRequires: mvn(org.apache.maven:maven-artifact:2.2.1) -BuildRequires: mvn(org.apache.maven:maven-artifact-manager) +BuildRequires: mvn(org.apache.maven:maven-artifact) +BuildRequires: mvn(org.apache.maven:maven-compat) BuildRequires: mvn(org.apache.maven:maven-core) -BuildRequires: mvn(org.apache.maven:maven-model:2.2.1) +BuildRequires: mvn(org.apache.maven:maven-model) BuildRequires: mvn(org.apache.maven:maven-plugin-api) -BuildRequires: mvn(org.apache.maven:maven-project) -BuildRequires: mvn(org.apache.maven:maven-toolchain) BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations) +BuildRequires: mvn(org.apache.maven.shared:maven-plugin-testing-harness) BuildRequires: mvn(org.codehaus.mojo:mojo-parent:pom:) BuildRequires: mvn(org.codehaus.plexus:plexus-component-annotations) BuildRequires: mvn(org.codehaus.plexus:plexus-component-metadata) +BuildRequires: mvn(org.codehaus.plexus:plexus-interpolation) BuildRequires: mvn(org.codehaus.plexus:plexus-utils) Obsoletes: maven-plugin-exec < %{version}-%{release} @@ -42,11 +46,19 @@ API documentation for %{name}. sed -i 's/\r$//' LICENSE.txt find . -name *.jar -delete +%pom_remove_dep :maven-project +%pom_remove_dep :maven-toolchain +%pom_remove_dep :maven-artifact-manager + +%pom_add_dep org.apache.maven:maven-compat +%pom_add_dep junit:junit::test + %pom_remove_plugin :animal-sniffer-maven-plugin +%patch1 -p1 + %build -# tests are disabled, see: rhbz#1095077 -%mvn_build -f +%mvn_build -- -DmavenVersion=3 %install %mvn_install @@ -59,6 +71,10 @@ find . -name *.jar -delete %doc LICENSE.txt %changelog +* Thu Sep 20 2018 Marian Koncek - 1.6.0-5 +- Port to Maven 3 to enable tests. +- Resolves: rhbz#1095077 + * Fri Jul 13 2018 Fedora Release Engineering - 1.6.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild