From 6456c7238838fb2a3a5eff187e80aba44b8aa10b Mon Sep 17 00:00:00 2001 From: Stanislav Ochotnicky Date: Wed, 25 Jul 2012 09:59:34 +0200 Subject: [PATCH] Fix exit code of mvn-rpmbuild outside of mock - Make sure we look for original asked-for version first version variable can be overwritten later in the function so we make sure to use the original value --- JavadirWorkspaceReader.java | 3 ++- maven-script-rpmbuild | 2 +- maven.spec | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/JavadirWorkspaceReader.java b/JavadirWorkspaceReader.java index 1698929..d231e7d 100644 --- a/JavadirWorkspaceReader.java +++ b/JavadirWorkspaceReader.java @@ -54,6 +54,7 @@ public class JavadirWorkspaceReader implements WorkspaceReader { String artifactId = artifact.getArtifactId(); String groupId = artifact.getGroupId(); String version = artifact.getVersion(); + String wantedVersion = new String(version); MavenJPackageDepmap.debug("Wanted GROUPID=" + groupId); MavenJPackageDepmap.debug("Wanted ARTIFACTID=" + artifactId); @@ -80,7 +81,7 @@ public class JavadirWorkspaceReader implements WorkspaceReader { "/usr/share/maven/repository-java-jni/", "/usr/share/maven/repository-jni/" }; String verRelativeArtifactPath = groupId + "/" + artifactId + "-" - + version + "." + artifact.getExtension(); + + wantedVersion + "." + artifact.getExtension(); String relativeArtifactPath = groupId + "/" + artifactId + "." + artifact.getExtension(); for (String repo : repos) { diff --git a/maven-script-rpmbuild b/maven-script-rpmbuild index f50b2f1..095d14d 100644 --- a/maven-script-rpmbuild +++ b/maven-script-rpmbuild @@ -76,7 +76,7 @@ export JAVA_HOME export MAVEN_OPTS="$MAVEN_OPTS -Dmaven.local.mode ${local_add} ${logfile_add}" $M2_HOME/bin/mvn -o "$@" || exit $? -$mock || exit +$mock || exit 0 sanitize() { for obj in $1; do diff --git a/maven.spec b/maven.spec index c3aa72c..de21e71 100644 --- a/maven.spec +++ b/maven.spec @@ -2,7 +2,7 @@ Name: maven Version: 3.0.4 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Java project management and project comprehension tool Group: Development/Tools @@ -367,6 +367,10 @@ ln -sf `rpm --eval '%%{_jnidir}'` %{_datadir}/%{name}/repository-jni/JPP %changelog +* Wed Jul 25 2012 Stanislav Ochotnicky - 3.0.4-10 +- Fix exit code of mvn-rpmbuild outside of mock +- Fix bug in compatibility jar handling + * Mon Jul 23 2012 Mikolaj Izdebski - 3.0.4-9 - Run redundant dependency checks only in mock