Skip to content

Commit

Permalink
Fix the versions-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
definite committed Apr 25, 2018
1 parent cd86e27 commit 9295259
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
4 changes: 0 additions & 4 deletions jenkins/maven-Jenkinsfile
Expand Up @@ -31,10 +31,6 @@ timestamps {
String developmentVersion = null
String artifactId = null

// chooses projects whose versions should be changed
// To be passed as -pl <Projects> in maven
String setPomVersionProjects = null

// List all artifacts to be released in sonatype nexus
// To be passed as -pl <Projects> in maven
String nexusStagingProjects = null
Expand Down
2 changes: 1 addition & 1 deletion zanata-env.sh
Expand Up @@ -111,7 +111,7 @@ MAVEN_NEXUS_STAGING_PLUGIN="org.sonatype.plugins:nexus-staging-maven-plugin"
MAVEN_NEXUS_STAGING_OPTIONS="-DnexusUrl=https://oss.sonatype.org/ -DserverId=sonatype-staging"

## zanata-platform
PLATFORM_MAVEN_VERSION_PROJECT="build-tools,parent"
PLATFORM_MAVEN_PARENT_PROJECT="parent"
PLATFORM_MAVEN_NEXUS_RELEASE_PROJECTS="!server/zanata-test-war,!server/functional-test"
PLATFORM_MAVEN_RELEASE_PROFILES="release"
PLATFORM_STAGING_REPOSITORY="orgzanata"
Expand Down
6 changes: 2 additions & 4 deletions zanata-nexus-release
Expand Up @@ -38,14 +38,12 @@ RepoName=$(repo_name_get)
ArtifactId=$(get_artifact_id $RepoName)
Version=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:exec)

MavenReleaseProfiles=$(get_artifact_var_value $ArtifactId maven_release_profiles)

## List all artifacts to be released in sonatype nexus
## e.g. !server/zanata-test-war,!server/functional-test
NexusReleaseProjects=$(get_artifact_var_value $ArtifactId maven_nexus_release_project )
NexusReleaseProjects=$(get_artifact_var_value $ArtifactId MAVEN_NEXUS_RELEASE_PROJECT )

## Staging repository prefix, e.g. orgzanata
NexusStagingRepositoryPrefix=$(get_artifact_var_value $ArtifactId staging_repository)
NexusStagingRepositoryPrefix=$(get_artifact_var_value $ArtifactId STAGING_REPOSITORY)

## default values
Projects="$NexusReleaseProjects"
Expand Down
4 changes: 2 additions & 2 deletions zanata-nexus-staging
Expand Up @@ -36,11 +36,11 @@ RepoName=$(repo_name_get)
ArtifactId=$(get_artifact_id $RepoName)
Version=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:exec)

MavenReleaseProfiles=$(get_artifact_var_value $ArtifactId maven_release_profiles)
MavenReleaseProfiles=$(get_artifact_var_value $ArtifactId MAVEN_RELEASE_PROFILES)

## List all artifacts to be released in sonatype nexus
## e.g. !server/zanata-test-war,!server/functional-test
NexusReleaseProjects=$(get_artifact_var_value $ArtifactId maven_nexus_release_project)
NexusReleaseProjects=$(get_artifact_var_value $ArtifactId MAVEN_NEXUS_RELEASE_PROJECT)

## default variables
Projects=$NexusReleaseProjects
Expand Down
10 changes: 6 additions & 4 deletions zanata-pom-set-version
Expand Up @@ -34,13 +34,13 @@ ArtifactId=$(get_artifact_id $RepoName)

## chooses projects whose versions should be changed
## eg: -pl build-tools,parent
MavenVersionProjects=$(get_artifact_var_value $ArtifactId maven_version_project )
ParentProject=$(get_artifact_var_value $ArtifactId MAVEN_PARENT_PROJECT )

## Tag message refers to release notes if release-notes is not empty
ReleaseNotesFile=$(get_artifact_var_value $ArtifactId release_notes_file )
ReleaseNotesFile=$(get_artifact_var_value $ArtifactId RELEASE_NOTES_FILE )

## default variables
Projects=$MavenVersionProjects
Projects=$ParentProject

###
### OPTIONS
Expand Down Expand Up @@ -79,12 +79,14 @@ fi
[[ -n ${1:-} ]] && Projects="$1"
if [[ -n $Projects && $Projects != 'null' ]]; then
ProjectOpts="-pl $Projects"
elif [[ -n $ParentProject ]]; then
ProjectOpts="-pl $Projects"
else
ProjectOpts=""
fi

run_command sed -i -e 's|<tag>.*</tag>|<tag>'$ScmTag'</tag>|' $(find . -name pom.xml | xargs )
run_command ./mvnw ${MAVEN_COMMON_OPTIONS:-} $ProjectOpts versions:set -DnewVersion=$Version
run_command ./mvnw ${MAVEN_COMMON_OPTIONS:-} $ProjectOpts versions:set -DnewVersion=$Version -DprocessAllModules
run_command git commit -a -m "$CommitMessage"

if [[ $SnapshotMode -eq 0 ]]; then
Expand Down

0 comments on commit 9295259

Please sign in to comment.