From 3841bb673873d619d25869726dbdb7a29395414c Mon Sep 17 00:00:00 2001 From: Jimisola Laursen Date: Tue, 5 Nov 2024 17:00:28 +0100 Subject: [PATCH] fix: Removed non-fully functional dynamic version goal (#1172) --- .../invoker.properties | 5 --- .../pom.xml | 11 ------- .../selector.groovy | 10 ------ .../setup.groovy | 11 ------- .../verify.groovy | 12 ------- .../invoker.properties | 4 --- .../pom.xml | 11 ------- .../selector.groovy | 10 ------ .../setup.groovy | 16 ---------- .../verify.groovy | 19 ----------- .../invoker.properties | 4 --- .../pom.xml | 11 ------- .../selector.groovy | 10 ------ .../setup.groovy | 30 ----------------- .../verify.groovy | 19 ----------- .../invoker.properties | 4 --- .../pom.xml | 11 ------- .../selector.groovy | 10 ------ .../setup.groovy | 17 ---------- .../verify.groovy | 19 ----------- .../invoker.properties | 4 --- .../pom.xml | 11 ------- .../selector.groovy | 10 ------ .../setup.groovy | 16 ---------- .../verify.groovy | 19 ----------- .../invoker.properties | 4 --- .../pom.xml | 11 ------- .../selector.groovy | 10 ------ .../setup.groovy | 16 ---------- .../verify.groovy | 19 ----------- .../invoker.properties | 4 --- .../pom.xml | 11 ------- .../selector.groovy | 10 ------ .../setup.groovy | 16 ---------- .../verify.groovy | 19 ----------- .../examples/use-dynamic-version-from-scm.md | 32 ------------------- .../src/site/markdown/index.md | 2 -- versions-maven-plugin/src/site/site.xml | 1 - 38 files changed, 459 deletions(-) delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/selector.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/setup.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/selector.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/setup.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/selector.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/setup.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/selector.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/setup.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/selector.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/setup.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/selector.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/setup.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/selector.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/setup.groovy delete mode 100644 versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/verify.groovy delete mode 100644 versions-maven-plugin/src/site/markdown/examples/use-dynamic-version-from-scm.md diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/invoker.properties b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/invoker.properties deleted file mode 100644 index 33fc6b2e3b..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/invoker.properties +++ /dev/null @@ -1,5 +0,0 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:use-dynamic-version-from-scm -invoker.buildResult = failure - -# https://issues.apache.org/jira/browse/MNG-8211 -invoker.maven.version = !4.0.0+, !3.9.10+ diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/pom.xml b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/pom.xml deleted file mode 100644 index 78bc48a827..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/pom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 4.0.0 - localhost - it-dynamic-versioning-scm-tag-0-commits-0-tags - ${revision} - pom - ranges-update-report - http://localhost/ - diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/selector.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/selector.groovy deleted file mode 100644 index 74f82d0070..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/selector.groovy +++ /dev/null @@ -1,10 +0,0 @@ -try { - // smoke test if we have a needed tools - def gitVersion = "git --version".execute() - gitVersion.consumeProcessOutput(System.out, System.out) - gitVersion.waitFor() - return gitVersion.exitValue() == 0 -} catch (Exception e) { - // some error occurs - we skip a test - return false -} diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/setup.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/setup.groovy deleted file mode 100644 index b03e421918..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/setup.groovy +++ /dev/null @@ -1,11 +0,0 @@ -void exec(String command) { - def proc = command.execute(null, basedir) - proc.consumeProcessOutput(System.out, System.out) - proc.waitFor() - assert proc.exitValue() == 0 : "Command '${command}' returned status: ${proc.exitValue()}" -} - -def testFile = new File(basedir, 'test.txt') -testFile << 'content' - -exec('git init') diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/verify.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/verify.groovy deleted file mode 100644 index e342730544..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-0-commits-0-tags/verify.groovy +++ /dev/null @@ -1,12 +0,0 @@ -// check that property was set - -def mavenLogFile = new File(basedir, 'build.log') -assert mavenLogFile.exists() : "Maven log file does not exist" - -// Read the log file -def logContent = mavenLogFile.text - -// Define a pattern to match the version output -def versionPattern = /Caused by: org.apache.maven.plugin.MojoExecutionException: SCM repo has no head\/commits\./ -def matcher = (logContent =~ versionPattern) -assert matcher.find() : "SCM repo should have no head/commits" diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/invoker.properties b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/invoker.properties deleted file mode 100644 index 0730290222..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/invoker.properties +++ /dev/null @@ -1,4 +0,0 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:use-dynamic-version-from-scm - -# https://issues.apache.org/jira/browse/MNG-8211 -invoker.maven.version = !4.0.0+, !3.9.10+ diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/pom.xml b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/pom.xml deleted file mode 100644 index 4f6aef7e24..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/pom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 4.0.0 - localhost - it-dynamic-versioning-scm-tag-1-commit-0-tags - ${revision} - pom - ranges-update-report - http://localhost/ - diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/selector.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/selector.groovy deleted file mode 100644 index 74f82d0070..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/selector.groovy +++ /dev/null @@ -1,10 +0,0 @@ -try { - // smoke test if we have a needed tools - def gitVersion = "git --version".execute() - gitVersion.consumeProcessOutput(System.out, System.out) - gitVersion.waitFor() - return gitVersion.exitValue() == 0 -} catch (Exception e) { - // some error occurs - we skip a test - return false -} diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/setup.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/setup.groovy deleted file mode 100644 index 4053e7dd39..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/setup.groovy +++ /dev/null @@ -1,16 +0,0 @@ -void exec(String command) { - def proc = command.execute(null, basedir) - proc.consumeProcessOutput(System.out, System.out) - proc.waitFor() - assert proc.exitValue() == 0 : "Command '${command}' returned status: ${proc.exitValue()}" -} - -def testFile = new File(basedir, 'test.txt') -testFile << 'content' - -exec('git init') -exec('git config user.email "you@example.com"') -exec('git config user.name "Your Name"') - -exec('git add test.txt') -exec('git commit -m initial-commit') diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/verify.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/verify.groovy deleted file mode 100644 index 3c42ac51e6..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-1-commit-0-tags/verify.groovy +++ /dev/null @@ -1,19 +0,0 @@ -// check that property was set - -def mavenLogFile = new File(basedir, 'build.log') -assert mavenLogFile.exists() : "Maven log file does not exist" - -// Read the log file -def logContent = mavenLogFile.text - -// Define a pattern to match the version output -def versionPattern = /\[INFO\] Property 'revision' set to: (.+)/ -def matcher = (logContent =~ versionPattern) -assert matcher.find() : "Version information not found in log file" - -// Extract the version from the matched group -def actualVersion = matcher[0][1] - -def expectedVersion = '0.0.1-1-SNAPSHOT' - -assert actualVersion == expectedVersion : "Expected version '${expectedVersion}', but found '${actualVersion}'" diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/invoker.properties b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/invoker.properties deleted file mode 100644 index a74c600f61..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/invoker.properties +++ /dev/null @@ -1,4 +0,0 @@ -invoker.goals=-X ${project.groupId}:${project.artifactId}:${project.version}:use-dynamic-version-from-scm - -# https://issues.apache.org/jira/browse/MNG-8211 -invoker.maven.version = !4.0.0+, !3.9.10+ diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/pom.xml b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/pom.xml deleted file mode 100644 index edb2c32957..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/pom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 4.0.0 - localhost - it-dynamic-versioning-scm-tag-4-commits-1-vtag - ${revision} - pom - ranges-update-report - http://localhost/ - diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/selector.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/selector.groovy deleted file mode 100644 index 74f82d0070..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/selector.groovy +++ /dev/null @@ -1,10 +0,0 @@ -try { - // smoke test if we have a needed tools - def gitVersion = "git --version".execute() - gitVersion.consumeProcessOutput(System.out, System.out) - gitVersion.waitFor() - return gitVersion.exitValue() == 0 -} catch (Exception e) { - // some error occurs - we skip a test - return false -} diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/setup.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/setup.groovy deleted file mode 100644 index d529d2ab13..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/setup.groovy +++ /dev/null @@ -1,30 +0,0 @@ -void exec(String command) { - def proc = command.execute(null, basedir) - proc.consumeProcessOutput(System.out, System.out) - proc.waitFor() - assert proc.exitValue() == 0 : "Command '${command}' returned status: ${proc.exitValue()}" -} - -def testFile = new File(basedir, 'test.txt') -testFile << 'content' - -exec('git init') -exec('git config user.email "you@example.com"') -exec('git config user.name "Your Name"') - -exec('git add test.txt') -exec('git commit -m initial-commit') -exec('git tag 1.1.1') -exec('git tag') - -testFile << 'content2' -exec('git add test.txt') -exec('git commit -m commit_no2') - -testFile << 'content3' -exec('git add test.txt') -exec('git commit -m commit_no3') - -testFile << 'content4' -exec('git add test.txt') -exec('git commit -m commit_no4') diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/verify.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/verify.groovy deleted file mode 100644 index 3ddc76fc89..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-4-commits-1-vtag/verify.groovy +++ /dev/null @@ -1,19 +0,0 @@ -// check that property was set - -def mavenLogFile = new File(basedir, 'build.log') -assert mavenLogFile.exists() : "Maven log file does not exist" - -// Read the log file -def logContent = mavenLogFile.text - -// Define a pattern to match the version output -def versionPattern = /\[INFO\] Property 'revision' set to: (.+)/ -def matcher = (logContent =~ versionPattern) -assert matcher.find() : "Version information not found in log file" - -// Extract the version from the matched group -def actualVersion = matcher[0][1] - -def expectedVersion = '1.1.2-4-SNAPSHOT' - -assert actualVersion == expectedVersion : "Expected version '${expectedVersion}', but found '${actualVersion}'" diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/invoker.properties b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/invoker.properties deleted file mode 100644 index 0730290222..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/invoker.properties +++ /dev/null @@ -1,4 +0,0 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:use-dynamic-version-from-scm - -# https://issues.apache.org/jira/browse/MNG-8211 -invoker.maven.version = !4.0.0+, !3.9.10+ diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/pom.xml b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/pom.xml deleted file mode 100644 index f5de5973f3..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/pom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 4.0.0 - localhost - it-dynamic-versioning-scm-tag-latest-commit - ${revision} - pom - ranges-update-report - http://localhost/ - diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/selector.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/selector.groovy deleted file mode 100644 index 74f82d0070..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/selector.groovy +++ /dev/null @@ -1,10 +0,0 @@ -try { - // smoke test if we have a needed tools - def gitVersion = "git --version".execute() - gitVersion.consumeProcessOutput(System.out, System.out) - gitVersion.waitFor() - return gitVersion.exitValue() == 0 -} catch (Exception e) { - // some error occurs - we skip a test - return false -} diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/setup.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/setup.groovy deleted file mode 100644 index a8873ec840..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/setup.groovy +++ /dev/null @@ -1,17 +0,0 @@ -void exec(String command) { - def proc = command.execute(null, basedir) - proc.consumeProcessOutput(System.out, System.out) - proc.waitFor() - assert proc.exitValue() == 0 : "Command '${command}' returned status: ${proc.exitValue()}" -} - -def testFile = new File(basedir, 'test.txt') -testFile << 'content' - -exec('git init') -exec('git config user.email "you@example.com"') -exec('git config user.name "Your Name"') - -exec('git add test.txt') -exec('git commit -m initial-commit') -exec('git tag v1.1.1') diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/verify.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/verify.groovy deleted file mode 100644 index 86e3aa9330..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-latest-commit/verify.groovy +++ /dev/null @@ -1,19 +0,0 @@ -// check that property was set - -def mavenLogFile = new File(basedir, 'build.log') -assert mavenLogFile.exists() : "Maven log file does not exist" - -// Read the log file -def logContent = mavenLogFile.text - -// Define a pattern to match the version output -def versionPattern = /\[INFO\] Property 'revision' set to: (.+)/ -def matcher = (logContent =~ versionPattern) -assert matcher.find() : "Version information not found in log file" - -// Extract the version from the matched group -def actualVersion = matcher[0][1] - -def expectedVersion = '1.1.1' - -assert actualVersion == expectedVersion : "Expected version '${expectedVersion}', but found '${actualVersion}'" diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/invoker.properties b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/invoker.properties deleted file mode 100644 index 8956b11783..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/invoker.properties +++ /dev/null @@ -1,4 +0,0 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:use-dynamic-version-from-scm -DappendSnapshot=false - -# https://issues.apache.org/jira/browse/MNG-8211 -invoker.maven.version = !4.0.0+, !3.9.10+ diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/pom.xml b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/pom.xml deleted file mode 100644 index 7acc0f9586..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/pom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 4.0.0 - localhost - it-dynamic-versioning-scm-tag-param-append-snapshot - ${revision} - pom - ranges-update-report - http://localhost/ - diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/selector.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/selector.groovy deleted file mode 100644 index 74f82d0070..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/selector.groovy +++ /dev/null @@ -1,10 +0,0 @@ -try { - // smoke test if we have a needed tools - def gitVersion = "git --version".execute() - gitVersion.consumeProcessOutput(System.out, System.out) - gitVersion.waitFor() - return gitVersion.exitValue() == 0 -} catch (Exception e) { - // some error occurs - we skip a test - return false -} diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/setup.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/setup.groovy deleted file mode 100644 index 4053e7dd39..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/setup.groovy +++ /dev/null @@ -1,16 +0,0 @@ -void exec(String command) { - def proc = command.execute(null, basedir) - proc.consumeProcessOutput(System.out, System.out) - proc.waitFor() - assert proc.exitValue() == 0 : "Command '${command}' returned status: ${proc.exitValue()}" -} - -def testFile = new File(basedir, 'test.txt') -testFile << 'content' - -exec('git init') -exec('git config user.email "you@example.com"') -exec('git config user.name "Your Name"') - -exec('git add test.txt') -exec('git commit -m initial-commit') diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/verify.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/verify.groovy deleted file mode 100644 index 522dee4138..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-append-snapshot/verify.groovy +++ /dev/null @@ -1,19 +0,0 @@ -// check that property was set - -def mavenLogFile = new File(basedir, 'build.log') -assert mavenLogFile.exists() : "Maven log file does not exist" - -// Read the log file -def logContent = mavenLogFile.text - -// Define a pattern to match the version output -def versionPattern = /\[INFO\] Property 'revision' set to: (.+)/ -def matcher = (logContent =~ versionPattern) -assert matcher.find() : "Version information not found in log file" - -// Extract the version from the matched group -def actualVersion = matcher[0][1] - -def expectedVersion = '0.0.1-1' - -assert actualVersion == expectedVersion : "Expected version '${expectedVersion}', but found '${actualVersion}'" diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/invoker.properties b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/invoker.properties deleted file mode 100644 index ad93651c05..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/invoker.properties +++ /dev/null @@ -1,4 +0,0 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:use-dynamic-version-from-scm -DuseVersion=9.9.9-9 - -# https://issues.apache.org/jira/browse/MNG-8211 -invoker.maven.version = !4.0.0+, !3.9.10+ diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/pom.xml b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/pom.xml deleted file mode 100644 index 08131ac356..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/pom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 4.0.0 - localhost - it-dynamic-versioning-scm-tag-param-use-versions - ${revision} - pom - ranges-update-report - http://localhost/ - diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/selector.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/selector.groovy deleted file mode 100644 index 74f82d0070..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/selector.groovy +++ /dev/null @@ -1,10 +0,0 @@ -try { - // smoke test if we have a needed tools - def gitVersion = "git --version".execute() - gitVersion.consumeProcessOutput(System.out, System.out) - gitVersion.waitFor() - return gitVersion.exitValue() == 0 -} catch (Exception e) { - // some error occurs - we skip a test - return false -} diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/setup.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/setup.groovy deleted file mode 100644 index 4053e7dd39..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/setup.groovy +++ /dev/null @@ -1,16 +0,0 @@ -void exec(String command) { - def proc = command.execute(null, basedir) - proc.consumeProcessOutput(System.out, System.out) - proc.waitFor() - assert proc.exitValue() == 0 : "Command '${command}' returned status: ${proc.exitValue()}" -} - -def testFile = new File(basedir, 'test.txt') -testFile << 'content' - -exec('git init') -exec('git config user.email "you@example.com"') -exec('git config user.name "Your Name"') - -exec('git add test.txt') -exec('git commit -m initial-commit') diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/verify.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/verify.groovy deleted file mode 100644 index 4c2fe68a20..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-param-use-versions/verify.groovy +++ /dev/null @@ -1,19 +0,0 @@ -// check that property was set - -def mavenLogFile = new File(basedir, 'build.log') -assert mavenLogFile.exists() : "Maven log file does not exist" - -// Read the log file -def logContent = mavenLogFile.text - -// Define a pattern to match the version output -def versionPattern = /\[INFO\] Property 'revision' set to: (.+)/ -def matcher = (logContent =~ versionPattern) -assert matcher.find() : "Version information not found in log file" - -// Extract the version from the matched group -def actualVersion = matcher[0][1] - -def expectedVersion = '9.9.9-9' - -assert actualVersion == expectedVersion : "Expected version '${expectedVersion}', but found '${actualVersion}'" diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/invoker.properties b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/invoker.properties deleted file mode 100644 index bb0f34221b..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/invoker.properties +++ /dev/null @@ -1,4 +0,0 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:use-dynamic-version-from-scm -DpropertyName=version_from_scm - -# https://issues.apache.org/jira/browse/MNG-8211 -invoker.maven.version = !4.0.0+, !3.9.10+ diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/pom.xml b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/pom.xml deleted file mode 100644 index 593dcc5ae8..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/pom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - 4.0.0 - localhost - it-dynamic-versioning-scm-tag-env-use-version - ${revision} - pom - ranges-update-report - http://localhost/ - diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/selector.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/selector.groovy deleted file mode 100644 index 74f82d0070..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/selector.groovy +++ /dev/null @@ -1,10 +0,0 @@ -try { - // smoke test if we have a needed tools - def gitVersion = "git --version".execute() - gitVersion.consumeProcessOutput(System.out, System.out) - gitVersion.waitFor() - return gitVersion.exitValue() == 0 -} catch (Exception e) { - // some error occurs - we skip a test - return false -} diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/setup.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/setup.groovy deleted file mode 100644 index 4053e7dd39..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/setup.groovy +++ /dev/null @@ -1,16 +0,0 @@ -void exec(String command) { - def proc = command.execute(null, basedir) - proc.consumeProcessOutput(System.out, System.out) - proc.waitFor() - assert proc.exitValue() == 0 : "Command '${command}' returned status: ${proc.exitValue()}" -} - -def testFile = new File(basedir, 'test.txt') -testFile << 'content' - -exec('git init') -exec('git config user.email "you@example.com"') -exec('git config user.name "Your Name"') - -exec('git add test.txt') -exec('git commit -m initial-commit') diff --git a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/verify.groovy b/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/verify.groovy deleted file mode 100644 index 603724bd4a..0000000000 --- a/versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/verify.groovy +++ /dev/null @@ -1,19 +0,0 @@ -// check that property was set - -def mavenLogFile = new File(basedir, 'build.log') -assert mavenLogFile.exists() : "Maven log file does not exist" - -// Read the log file -def logContent = mavenLogFile.text - -// Define a pattern to match the version output -def versionPattern = /\[INFO\] Property 'version_from_scm' set to: (.+)/ -def matcher = (logContent =~ versionPattern) -assert matcher.find() : "Version information not found in log file" - -// Extract the version from the matched group -def actualVersion = matcher[0][1] - -def expectedVersion = '0.0.1-1-SNAPSHOT' - -assert actualVersion == expectedVersion : "Expected version '${expectedVersion}', but found '${actualVersion}'" diff --git a/versions-maven-plugin/src/site/markdown/examples/use-dynamic-version-from-scm.md b/versions-maven-plugin/src/site/markdown/examples/use-dynamic-version-from-scm.md deleted file mode 100644 index 895db7ebeb..0000000000 --- a/versions-maven-plugin/src/site/markdown/examples/use-dynamic-version-from-scm.md +++ /dev/null @@ -1,32 +0,0 @@ -title: Using use-dynamic-version-from-scm goal -author: Jimisola Laursen -date: 2024-06-22 - - - -The `use-dynamic-version-from-scm` goal will use scm/vcs (currently, only git) tags to determine the version for the current build and set that in a property (default: `revision`). It is intended to be used with [Maven CI Friendly Versions](https://maven.apache.org/maven-ci-friendly.html). The goal follows [Versions Maven Plugin - Version number rules](https://www.mojohaus.org/versions/versions-maven-plugin/version-rules.html). - -* The version tag can be with or without "v" prefix, i.e. "v1.2.3" or "1.2.3". -* The `-SNAPSHOT` qualifier suffix is optional (appended per default). -* If the parameter `useVersion` is set then that version will be used irrespective of commits/tags (is typically used for testing). -* The goal will determine the version for the current build as follows: - * latest commit has valid version tag: use the highest version tag for that commit (e.g. 1.2.3 -> 1.2.3) - * latest version has _no_ valid version tag: use the highest version tag for the most recent non-latest commit, increase incremental (patch) version with 1 and use the number of commits to that commit (commit count) as build number and `-SNAPSHOT qualifer appended (e.g. 1.2.3 -> 1.2.4-12-SNAPSHOT) - * no commit with valid version tag: use 0.0.1 (configurable) and use the number of commits to that commit (commit count) as build number and `-SNAPSHOT qualifer appended (e.g. 1.2.3 -> 1.2.4-12-SNAPSHOT) (e.g. 0.0.1-10-SNAPSHOT) - * repository has no commits: build fails with exception `Caused by: org.apache.maven.plugin.MojoExecutionException: SCM repo has no head/commits.` - diff --git a/versions-maven-plugin/src/site/markdown/index.md b/versions-maven-plugin/src/site/markdown/index.md index 48c386d5ed..a0f773e6b4 100644 --- a/versions-maven-plugin/src/site/markdown/index.md +++ b/versions-maven-plugin/src/site/markdown/index.md @@ -73,7 +73,6 @@ have been a newer version and replaces them with the latest version. built-in "Poor Man's SCM". * [versions:revert](./revert-mojo.html) restores the `pom.xml` files from the `pom.xml.versionsBackup` files. Forms one half of the built-in "Poor Man's SCM". -* [versions:use-dynamic-version-from-scm](./use-dynamic-version-from-scm-mojo.html) uses SCM/VCS tags to enable dynamic versioning and sets the version in a property. ## Reporting goals overview @@ -136,4 +135,3 @@ you can take a look into the following examples: * [Replacing -SNAPSHOT versions with their corresponding releases](./examples/use-releases.html) * [Changing the project version](./examples/set.html) * [Recording version changes](./examples/recording-changes.html) -* [Using use-dynamic-version-from-scm goal](./examples/use-dynamic-version-from-scm.html) diff --git a/versions-maven-plugin/src/site/site.xml b/versions-maven-plugin/src/site/site.xml index 1efa00cce5..cfdab72785 100644 --- a/versions-maven-plugin/src/site/site.xml +++ b/versions-maven-plugin/src/site/site.xml @@ -27,7 +27,6 @@ -