From 786c9ab3c65e621ed37d68679fc0541cef21b148 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Thu, 1 Mar 2012 21:53:15 +0100 Subject: [PATCH 01/42] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9081e57..fcc7631 100644 --- a/pom.xml +++ b/pom.xml @@ -6,12 +6,12 @@ plexus-components org.codehaus.plexus - 1.1.20 + 1.1.21-SNAPSHOT org.codehaus.plexus plexus-cli - 1.6 + 1.7-SNAPSHOT Plexus CLI Easily create CLIs with Plexus components From 98b3ac41220fc697143515564e4240b8c60477b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Mon, 8 Oct 2012 00:24:23 +0200 Subject: [PATCH 02/42] updated parent pom --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fcc7631..393215c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,10 +6,9 @@ plexus-components org.codehaus.plexus - 1.1.21-SNAPSHOT + 1.2 - org.codehaus.plexus plexus-cli 1.7-SNAPSHOT From cda03d5afa1ea5ff8f77703ca5c82285d6e6414e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Wed, 31 Oct 2012 16:12:43 +0100 Subject: [PATCH 03/42] updated parent pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 393215c..5157a59 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plexus-components org.codehaus.plexus - 1.2 + 1.3 plexus-cli From bd637052acbc339f6a2e2619cc364bf34e96f8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Wed, 31 Oct 2012 16:14:05 +0100 Subject: [PATCH 04/42] added classical component menu --- src/site/site.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/site/site.xml b/src/site/site.xml index 4597f21..a42e1f8 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -1,4 +1,15 @@ + + + + + + + + + + + From 81c687d6b1090d9d2523e5f8171d6a978ccaf1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Wed, 31 Oct 2012 16:25:58 +0100 Subject: [PATCH 05/42] removed bad copy/paste --- src/site/site.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/site.xml b/src/site/site.xml index a42e1f8..adc4a63 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -1,4 +1,4 @@ - From 54448cb13fd8a97738f5d48d21eac0711f4ae890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sun, 2 Dec 2012 00:56:17 +0100 Subject: [PATCH 06/42] updated parent pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5157a59..814058f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plexus-components org.codehaus.plexus - 1.3 + 1.3.1 plexus-cli From 5c4f475e2b127b57e6e592514ddce97e732ff946 Mon Sep 17 00:00:00 2001 From: Benson Margulies Date: Mon, 18 Aug 2014 12:44:58 -0400 Subject: [PATCH 07/42] Add scm. --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 814058f..10f3e9b 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,11 @@ Plexus CLI Easily create CLIs with Plexus components + + scn:git:git@github.com:sonatype/plexus-cli.git + scn:git:git@github.com:sonatype/plexus-cli.git + + org.codehaus.plexus From ae9f3a1299a34fd2d78143edc240194f8f1332b3 Mon Sep 17 00:00:00 2001 From: Benson Margulies Date: Mon, 18 Aug 2014 12:45:21 -0400 Subject: [PATCH 08/42] ignorance. --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b64043 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.target From a776afa6bca84e5107bedb69440329cdb24ed645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Thu, 21 Aug 2014 22:30:56 +0200 Subject: [PATCH 09/42] updated gitignore --- .gitignore | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5b64043..ece20be 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,7 @@ -.target +target/ +.project +.classpath +.settings/ +bin +*.iml +.idea From 1a47e398a60788b1e08182aac118a9baf1e1ac23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Tue, 4 Aug 2015 23:21:31 +0200 Subject: [PATCH 10/42] fixed typo: s/scn/scm/ --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 10f3e9b..889f774 100644 --- a/pom.xml +++ b/pom.xml @@ -16,8 +16,8 @@ Easily create CLIs with Plexus components - scn:git:git@github.com:sonatype/plexus-cli.git - scn:git:git@github.com:sonatype/plexus-cli.git + scm:git:git@github.com:sonatype/plexus-cli.git + scm:git:git@github.com:sonatype/plexus-cli.git From 10082dc0c4345eceeddb0a1090f544400e0286ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Tue, 4 Aug 2015 23:33:34 +0200 Subject: [PATCH 11/42] use codehaus-plexus github org --- pom.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 889f774..b329bc4 100644 --- a/pom.xml +++ b/pom.xml @@ -16,9 +16,15 @@ Easily create CLIs with Plexus components - scm:git:git@github.com:sonatype/plexus-cli.git - scm:git:git@github.com:sonatype/plexus-cli.git + scm:git:git@github.com:codehaus-plexus/plexus-cli.git + scm:git:git@github.com:codehaus-plexus/plexus-cli.git + http://github.com/codehaus-plexus/plexus-cli + HEAD + + github + http://github.com/codehaus-plexus/plexus-cli/issues + From 4204d1cb2e2addc4d90fffa22cbe6f3868f8ebf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sat, 26 Sep 2015 23:29:11 +0200 Subject: [PATCH 12/42] updated parent pom and prepared site publication --- pom.xml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b329bc4..b7fefb8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plexus-components org.codehaus.plexus - 1.3.1 + 4.0-SNAPSHOT plexus-cli @@ -25,6 +25,12 @@ github http://github.com/codehaus-plexus/plexus-cli/issues + + + github:gh-pages + ${project.scm.developerConnection} + + @@ -52,4 +58,25 @@ + + + + + org.apache.maven.plugins + maven-scm-publish-plugin + + ${project.reporting.outputDirectory} + + + + scm-publish + site-deploy + + publish-scm + + + + + + From 9fba5d5003e9343d907dd5f1baf9d319778a8815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sat, 12 May 2018 14:54:18 +0200 Subject: [PATCH 13/42] added README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..22bcf0a --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +Plexus-CLI +=============== + +[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/codehaus-plexus/plexus-cli.svg?label=License)](http://www.apache.org/licenses/) +[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-cli.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.codehaus.plexus%22%20a%3A%22plexus-cli%22) +[![Build Status](https://travis-ci.org/codehaus-plexus/plexus-cli.svg?branch=master)](https://travis-ci.org/codehaus-plexus/plexus-cli) + +The canonical git repository is located at https://github.com/codehaus-plexus/plexus-cli From 59f6e37df7a7825247a4606938161ed8fd74de80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sat, 7 Dec 2019 18:17:03 +0100 Subject: [PATCH 14/42] parent POM released --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b7fefb8..013cf55 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plexus-components org.codehaus.plexus - 4.0-SNAPSHOT + 4.0 plexus-cli From 547718790c29f0afb7fa7339fa4a612dbbfa85f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Tue, 21 Jan 2020 19:53:05 +0100 Subject: [PATCH 15/42] activate Reproducible Builds --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 013cf55..1300e84 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plexus-components org.codehaus.plexus - 4.0 + 6.1 plexus-cli @@ -32,6 +32,10 @@ + + 2020-01-20T18:52:37Z + + org.codehaus.plexus From 9980e0a13d0bc3e42907d1670af143e2fb526f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sat, 17 Oct 2020 19:11:48 +0200 Subject: [PATCH 16/42] update parent pom to 6.5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1300e84..a4af152 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plexus-components org.codehaus.plexus - 6.1 + 6.5 plexus-cli From 14462bcdb163abfe477ef0bda76ce7c16dbfbf5f Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sun, 18 Apr 2021 10:38:47 +0200 Subject: [PATCH 17/42] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..a743f15 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,67 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '39 11 * * 4' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 7cd2cc7c0cff3a59e737cf0e0fd79379bd75dc70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Fri, 30 Jul 2021 06:39:38 +0200 Subject: [PATCH 18/42] update search.maven.org url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22bcf0a..f4401b0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Plexus-CLI =============== [![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/codehaus-plexus/plexus-cli.svg?label=License)](http://www.apache.org/licenses/) -[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-cli.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.codehaus.plexus%22%20a%3A%22plexus-cli%22) +[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-cli.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-cli) [![Build Status](https://travis-ci.org/codehaus-plexus/plexus-cli.svg?branch=master)](https://travis-ci.org/codehaus-plexus/plexus-cli) The canonical git repository is located at https://github.com/codehaus-plexus/plexus-cli From 8beb52690777e5d9ead2015cb076f0a34800305c Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Wed, 22 Dec 2021 21:23:40 +0100 Subject: [PATCH 19/42] Update GH Actions setup --- .github/dependabot.yml | 27 +++++++++++ .github/workflows/codeql-analysis.yml | 67 --------------------------- .github/workflows/maven.yml | 28 +++++++++++ 3 files changed, 55 insertions(+), 67 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/maven.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f0138ad --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,27 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index a743f15..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '39 11 * * 4' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'java' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..41d662d --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,28 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +name: Java CI + +on: + push: + branches-ignore: + - dependabot/** + pull_request: + +jobs: + build: + name: Verify + uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1 From 080c0a4274c626a27fb5a1eff6c735985c9f5a1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Dec 2021 20:26:40 +0000 Subject: [PATCH 20/42] Bump plexus-components from 6.5 to 6.6 Bumps [plexus-components](https://github.com/codehaus-plexus/plexus-components) from 6.5 to 6.6. - [Release notes](https://github.com/codehaus-plexus/plexus-components/releases) - [Commits](https://github.com/codehaus-plexus/plexus-components/compare/plexus-components-6.5...plexus-components-6.6) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus-components dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a4af152..fd83007 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plexus-components org.codehaus.plexus - 6.5 + 6.6 plexus-cli From aa9c725bfb56d7a7650d56c8e277471cee82d003 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Wed, 22 Dec 2021 23:12:23 +0100 Subject: [PATCH 21/42] Fix ci build --- pom.xml | 22 +++++++++++++++++++ .../plexus/tools/cli/AbstractCli.java | 2 -- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fd83007..ee3152b 100644 --- a/pom.xml +++ b/pom.xml @@ -64,6 +64,28 @@ + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.1.2 + + + com.puppycrawl.tools + checkstyle + 9.2 + + + org.apache.maven.shared + maven-shared-resources + 4 + + + + + + org.apache.maven.plugins diff --git a/src/main/java/org/codehaus/plexus/tools/cli/AbstractCli.java b/src/main/java/org/codehaus/plexus/tools/cli/AbstractCli.java index 1763c5a..aac570d 100644 --- a/src/main/java/org/codehaus/plexus/tools/cli/AbstractCli.java +++ b/src/main/java/org/codehaus/plexus/tools/cli/AbstractCli.java @@ -39,8 +39,6 @@ /** * @author jason van zyl - * @version $Id$ - * @noinspection UseOfSystemOutOrSystemErr,ACCESS_STATIC_VIA_INSTANCE */ public abstract class AbstractCli implements Cli From 4503fd714350bade1280c821686f334b0e48d65a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Dec 2021 05:20:30 +0000 Subject: [PATCH 22/42] Bump checkstyle from 9.2 to 9.2.1 Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 9.2 to 9.2.1. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-9.2...checkstyle-9.2.1) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ee3152b..cf37505 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ com.puppycrawl.tools checkstyle - 9.2 + 9.2.1 org.apache.maven.shared From 5081d42e7f53b8220f44602491864d016acc2697 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Dec 2021 05:26:49 +0000 Subject: [PATCH 23/42] Bump plexus-container-default from 1.0-alpha-34 to 2.1.1 Bumps [plexus-container-default](https://github.com/codehaus-plexus/plexus-containers) from 1.0-alpha-34 to 2.1.1. - [Release notes](https://github.com/codehaus-plexus/plexus-containers/releases) - [Changelog](https://github.com/codehaus-plexus/plexus-containers/blob/master/ReleaseNotes.md) - [Commits](https://github.com/codehaus-plexus/plexus-containers/commits/plexus-containers-2.1.1) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus-container-default dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cf37505..b4d9773 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ org.codehaus.plexus plexus-container-default - 1.0-alpha-34 + 2.1.1 org.codehaus.plexus From 6841bfc312a1f2e6559a52dba5ae510704797a24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Jan 2022 05:34:59 +0000 Subject: [PATCH 24/42] Bump checkstyle from 9.2.1 to 9.3 Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 9.2.1 to 9.3. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-9.2.1...checkstyle-9.3) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b4d9773..ea8dcc4 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ com.puppycrawl.tools checkstyle - 9.2.1 + 9.3 org.apache.maven.shared From 54428c7c16934018239161d62f6c5e8981aaaac7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Dec 2021 22:13:38 +0000 Subject: [PATCH 25/42] Bump commons-cli from 1.0 to 1.5.0 Bumps commons-cli from 1.0 to 1.5.0. --- updated-dependencies: - dependency-name: commons-cli:commons-cli dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ea8dcc4..3e131c6 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ commons-cli commons-cli - 1.0 + 1.5.0 commons-lang From 6b5669eb93ce158478168363b40eee9a4a64b215 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jun 2022 05:22:59 +0000 Subject: [PATCH 26/42] Bump plexus-components from 6.6 to 9.0 Bumps [plexus-components](https://github.com/codehaus-plexus/plexus-components) from 6.6 to 9.0. - [Release notes](https://github.com/codehaus-plexus/plexus-components/releases) - [Commits](https://github.com/codehaus-plexus/plexus-components/compare/plexus-components-6.6...plexus-components-9.0) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus-components dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3e131c6..c1856b0 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plexus-components org.codehaus.plexus - 6.6 + 9.0 plexus-cli From 8148be2585d1db0845c35cd240422c1cb6bdcdde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 05:31:55 +0000 Subject: [PATCH 27/42] Bump plexus-components from 9.0 to 10.0 Bumps [plexus-components](https://github.com/codehaus-plexus/plexus-components) from 9.0 to 10.0. - [Release notes](https://github.com/codehaus-plexus/plexus-components/releases) - [Commits](https://github.com/codehaus-plexus/plexus-components/compare/plexus-components-9.0...plexus-components-10.0) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus-components dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c1856b0..99a5fd6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plexus-components org.codehaus.plexus - 9.0 + 10.0 plexus-cli From 5500a9165f92fcbe6cd9b2a63113c3b51e325ea0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Aug 2022 05:22:45 +0000 Subject: [PATCH 28/42] Bump maven-checkstyle-plugin from 3.1.2 to 3.2.0 Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.1.2 to 3.2.0. - [Release notes](https://github.com/apache/maven-checkstyle-plugin/releases) - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.1.2...maven-checkstyle-plugin-3.2.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 99a5fd6..9025928 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.1.2 + 3.2.0 com.puppycrawl.tools From 3224b48140e84e2fdeb4f131a2b237ffcdeebd83 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 05:04:49 +0000 Subject: [PATCH 29/42] Bump maven-shared-resources from 4 to 5 Bumps [maven-shared-resources](https://github.com/apache/maven-shared-resources) from 4 to 5. - [Release notes](https://github.com/apache/maven-shared-resources/releases) - [Commits](https://github.com/apache/maven-shared-resources/commits) --- updated-dependencies: - dependency-name: org.apache.maven.shared:maven-shared-resources dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9025928..7720056 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ org.apache.maven.shared maven-shared-resources - 4 + 5 From 44897e2768acfa08b3b781128f59242de49badd2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 06:02:09 +0000 Subject: [PATCH 30/42] Bump apache/maven-gh-actions-shared from 1 to 3 Bumps [apache/maven-gh-actions-shared](https://github.com/apache/maven-gh-actions-shared) from 1 to 3. - [Release notes](https://github.com/apache/maven-gh-actions-shared/releases) - [Commits](https://github.com/apache/maven-gh-actions-shared/compare/v1...v3) --- updated-dependencies: - dependency-name: apache/maven-gh-actions-shared dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 41d662d..d2e5d8f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -25,4 +25,4 @@ on: jobs: build: name: Verify - uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1 + uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3 From f94127937d6b3eb12beb4ce31f3a82849213a0f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 19 Mar 2023 21:43:33 +0000 Subject: [PATCH 31/42] Bump maven-checkstyle-plugin from 3.2.0 to 3.2.1 Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/apache/maven-checkstyle-plugin/releases) - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.2.0...maven-checkstyle-plugin-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7720056..0b3b0b6 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.0 + 3.2.1 com.puppycrawl.tools From 7cd930a8f7e2751ac315ae2b662840ca3a2850fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Apr 2023 05:58:58 +0000 Subject: [PATCH 32/42] Bump maven-checkstyle-plugin from 3.2.1 to 3.2.2 Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/apache/maven-checkstyle-plugin/releases) - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.2.1...maven-checkstyle-plugin-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0b3b0b6..fc3aa83 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.1 + 3.2.2 com.puppycrawl.tools From 96a68acb742c27aca04c324eea89abd3e12661c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 05:59:08 +0000 Subject: [PATCH 33/42] Bump maven-checkstyle-plugin from 3.2.2 to 3.3.0 Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.2.2 to 3.3.0. - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.2.2...maven-checkstyle-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fc3aa83..4f1f7e0 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.2 + 3.3.0 com.puppycrawl.tools From c7be73e868140ef12f09ffc6c1c810f95bf8fdd9 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Tue, 3 Oct 2023 20:12:24 +0200 Subject: [PATCH 34/42] Update to Parent pom 15 --- pom.xml | 61 +++++++++++++++++---------------------------------------- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/pom.xml b/pom.xml index 4f1f7e0..b5ed889 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 - plexus-components org.codehaus.plexus - 10.0 + plexus + 15 plexus-cli @@ -16,14 +15,14 @@ Easily create CLIs with Plexus components - scm:git:git@github.com:codehaus-plexus/plexus-cli.git - scm:git:git@github.com:codehaus-plexus/plexus-cli.git - http://github.com/codehaus-plexus/plexus-cli + scm:git:https://github.com/codehaus-plexus/plexus-cli.git + scm:git:https://github.com/codehaus-plexus/plexus-cli.git HEAD + https://github.com/codehaus-plexus/plexus-cli/tree/${project.scm.tag}/ github - http://github.com/codehaus-plexus/plexus-cli/issues + https://github.com/codehaus-plexus/plexus-cli/issues @@ -35,7 +34,7 @@ 2020-01-20T18:52:37Z - + org.codehaus.plexus @@ -45,61 +44,37 @@ org.codehaus.plexus plexus-utils + 4.0.0 + + + org.codehaus.plexus + plexus-xml + 3.0.0 commons-cli commons-cli 1.5.0 - - - commons-lang - commons-lang - - - commons-logging - commons-logging - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.3.0 - - - com.puppycrawl.tools - checkstyle - 9.3 - - - org.apache.maven.shared - maven-shared-resources - 5 - - - - - - org.apache.maven.plugins maven-scm-publish-plugin - ${project.reporting.outputDirectory} + + ${project.reporting.outputDirectory} + scm-publish - site-deploy publish-scm + site-deploy From 21b6b41cb15a9e6fa11a14e44b48fa34b21ded0a Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Tue, 3 Oct 2023 20:12:46 +0200 Subject: [PATCH 35/42] Format code --- .../plexus/tools/cli/AbstractCli.java | 352 +++++++----------- .../org/codehaus/plexus/tools/cli/Cli.java | 13 +- .../codehaus/plexus/tools/cli/CliTest.java | 32 +- .../codehaus/plexus/tools/cli/TestCli.java | 43 +-- 4 files changed, 175 insertions(+), 265 deletions(-) diff --git a/src/main/java/org/codehaus/plexus/tools/cli/AbstractCli.java b/src/main/java/org/codehaus/plexus/tools/cli/AbstractCli.java index aac570d..505c128 100644 --- a/src/main/java/org/codehaus/plexus/tools/cli/AbstractCli.java +++ b/src/main/java/org/codehaus/plexus/tools/cli/AbstractCli.java @@ -16,6 +16,12 @@ * limitations under the License. */ +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.GnuParser; @@ -31,18 +37,10 @@ import org.codehaus.plexus.classworlds.ClassWorld; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - /** * @author jason van zyl */ -public abstract class AbstractCli - implements Cli -{ +public abstract class AbstractCli implements Cli { // ---------------------------------------------------------------------------- // These are standard options that we would want to use for all our projects. // ---------------------------------------------------------------------------- @@ -63,61 +61,51 @@ public abstract class AbstractCli // Abstract methods // ---------------------------------------------------------------------------- - public abstract Options buildCliOptions( Options options ); + public abstract Options buildCliOptions(Options options); - public abstract void invokePlexusComponent( CommandLine cli, - PlexusContainer container ) - throws Exception; + public abstract void invokePlexusComponent(CommandLine cli, PlexusContainer container) throws Exception; - public String getPomPropertiesPath() - { + public String getPomPropertiesPath() { return null; } - public int execute( String[] args ) - { - ClassWorld classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() ); + public int execute(String[] args) { + ClassWorld classWorld = + new ClassWorld("plexus.core", Thread.currentThread().getContextClassLoader()); - return execute( args, classWorld ); + return execute(args, classWorld); } - public int execute( String[] args, - ClassWorld classWorld ) - { + public int execute(String[] args, ClassWorld classWorld) { CommandLine cli; - try - { - cli = parse( args ); - } - catch ( ParseException e ) - { - System.err.println( "Unable to parse command line options: " + e.getMessage() ); + try { + cli = parse(args); + } catch (ParseException e) { + System.err.println("Unable to parse command line options: " + e.getMessage()); displayHelp(); return 1; } - if ( System.getProperty( "java.class.version", "44.0" ).compareTo( "48.0" ) < 0 ) - { - System.err.println( "Sorry, but JDK 1.4 or above is required to execute Maven" ); + if (System.getProperty("java.class.version", "44.0").compareTo("48.0") < 0) { + System.err.println("Sorry, but JDK 1.4 or above is required to execute Maven"); System.err.println( - "You appear to be using Java version: " + System.getProperty( "java.version", "" ) ); + "You appear to be using Java version: " + System.getProperty("java.version", "")); return 1; } - boolean debug = cli.hasOption( DEBUG ); + boolean debug = cli.hasOption(DEBUG); - boolean quiet = !debug && cli.hasOption( QUIET ); + boolean quiet = !debug && cli.hasOption(QUIET); - boolean showErrors = debug || cli.hasOption( ERRORS ); + boolean showErrors = debug || cli.hasOption(ERRORS); - if ( showErrors ) - { - System.out.println( "+ Error stacktraces are turned on." ); + if (showErrors) { + System.out.println("+ Error stacktraces are turned on."); } // ---------------------------------------------------------------------------- @@ -126,16 +114,11 @@ public int execute( String[] args, int loggingLevel; - if ( debug ) - { + if (debug) { loggingLevel = 0; - } - else if ( quiet ) - { + } else if (quiet) { loggingLevel = 0; - } - else - { + } else { loggingLevel = 0; } @@ -143,21 +126,17 @@ else if ( quiet ) // Process particular command line options // ---------------------------------------------------------------------- - if ( cli.hasOption( HELP ) ) - { + if (cli.hasOption(HELP)) { displayHelp(); return 0; } - if ( cli.hasOption( VERSION ) ) - { + if (cli.hasOption(VERSION)) { showVersion(); return 0; - } - else if ( debug ) - { + } else if (debug) { showVersion(); } @@ -165,66 +144,46 @@ else if ( debug ) // This is what we will generalize for the invocation of the command line. // ---------------------------------------------------------------------------- - try - { - ContainerConfiguration configuration = new DefaultContainerConfiguration() - .setClassWorld( classWorld ); + try { + ContainerConfiguration configuration = new DefaultContainerConfiguration().setClassWorld(classWorld); - customizeContainerConfiguration( configuration, cli ); - - PlexusContainer plexus = new DefaultPlexusContainer( configuration ); + customizeContainerConfiguration(configuration, cli); - invokePlexusComponent( cli, plexus ); - } - catch ( PlexusContainerException e ) - { - showFatalError( "Cannot create Plexus container.", e, true ); - } - catch ( ComponentLookupException e ) - { - showError( "Cannot lookup application component.", e, true ); - } - catch ( Exception e ) - { - showError( "Problem executing command line.", e, true ); + PlexusContainer plexus = new DefaultPlexusContainer(configuration); + + invokePlexusComponent(cli, plexus); + } catch (PlexusContainerException e) { + showFatalError("Cannot create Plexus container.", e, true); + } catch (ComponentLookupException e) { + showError("Cannot lookup application component.", e, true); + } catch (Exception e) { + showError("Problem executing command line.", e, true); } return 0; } - protected void customizeContainerConfiguration( ContainerConfiguration configuration, CommandLine cli ) - { - } - - protected int showFatalError( String message, - Exception e, - boolean show ) - { - System.err.println( "FATAL ERROR: " + message ); + protected void customizeContainerConfiguration(ContainerConfiguration configuration, CommandLine cli) {} - if ( show ) - { - System.err.println( "Error stacktrace:" ); + protected int showFatalError(String message, Exception e, boolean show) { + System.err.println("FATAL ERROR: " + message); + + if (show) { + System.err.println("Error stacktrace:"); e.printStackTrace(); - } - else - { - System.err.println( "For more information, run with the -e flag" ); + } else { + System.err.println("For more information, run with the -e flag"); } return 1; } - protected void showError( String message, - Exception e, - boolean show ) - { - System.err.println( message ); + protected void showError(String message, Exception e, boolean show) { + System.err.println(message); - if ( show ) - { - System.err.println( "Error stacktrace:" ); + if (show) { + System.err.println("Error stacktrace:"); e.printStackTrace(); } @@ -232,47 +191,38 @@ protected void showError( String message, // Need to get the versions of the application in a general way, so that I need a way to get the // specifics of the application so that I can do this in a general way. - private void showVersion() - { + private void showVersion() { InputStream is; - try - { + try { Properties properties = new Properties(); String pomPropertiesPath = getPomPropertiesPath(); - if ( pomPropertiesPath == null ) - { - System.err.println( "Unable determine version from JAR file." ); + if (pomPropertiesPath == null) { + System.err.println("Unable determine version from JAR file."); return; } - is = AbstractCli.class.getClassLoader().getResourceAsStream( pomPropertiesPath ); + is = AbstractCli.class.getClassLoader().getResourceAsStream(pomPropertiesPath); - if ( is == null ) - { - System.err.println( "Unable determine version from JAR file." ); + if (is == null) { + System.err.println("Unable determine version from JAR file."); return; } - properties.load( is ); + properties.load(is); - if ( properties.getProperty( "builtOn" ) != null ) - { - System.out.println( "Version: " + properties.getProperty( "version", "unknown" ) + " built on " + - properties.getProperty( "builtOn" ) ); + if (properties.getProperty("builtOn") != null) { + System.out.println("Version: " + properties.getProperty("version", "unknown") + " built on " + + properties.getProperty("builtOn")); + } else { + System.out.println("Version: " + properties.getProperty("version", "unknown")); } - else - { - System.out.println( "Version: " + properties.getProperty( "version", "unknown" ) ); - } - } - catch ( IOException e ) - { - System.err.println( "Unable determine version from JAR file: " + e.getMessage() ); + } catch (IOException e) { + System.err.println("Unable determine version from JAR file: " + e.getMessage()); } } @@ -280,8 +230,7 @@ private void showVersion() // System properties handling // ---------------------------------------------------------------------- - private Properties getExecutionProperties( CommandLine commandLine ) - { + private Properties getExecutionProperties(CommandLine commandLine) { Properties executionProperties = new Properties(); // ---------------------------------------------------------------------- @@ -290,142 +239,127 @@ private Properties getExecutionProperties( CommandLine commandLine ) // are most dominant. // ---------------------------------------------------------------------- - if ( commandLine.hasOption( SET_SYSTEM_PROPERTY ) ) - { - String[] defStrs = commandLine.getOptionValues( SET_SYSTEM_PROPERTY ); + if (commandLine.hasOption(SET_SYSTEM_PROPERTY)) { + String[] defStrs = commandLine.getOptionValues(SET_SYSTEM_PROPERTY); - for ( int i = 0; i < defStrs.length; ++i ) - { - setCliProperty( defStrs[i], executionProperties ); + for (int i = 0; i < defStrs.length; ++i) { + setCliProperty(defStrs[i], executionProperties); } } - executionProperties.putAll( System.getProperties() ); + executionProperties.putAll(System.getProperties()); return executionProperties; } - private void setCliProperty( String property, - Properties executionProperties ) - { + private void setCliProperty(String property, Properties executionProperties) { String name; String value; - int i = property.indexOf( "=" ); + int i = property.indexOf("="); - if ( i <= 0 ) - { + if (i <= 0) { name = property.trim(); value = "true"; - } - else - { - name = property.substring( 0, i ).trim(); + } else { + name = property.substring(0, i).trim(); - value = property.substring( i + 1 ).trim(); + value = property.substring(i + 1).trim(); } - executionProperties.setProperty( name, value ); + executionProperties.setProperty(name, value); // ---------------------------------------------------------------------- // I'm leaving the setting of system properties here as not to break // the SystemPropertyProfileActivator. This won't harm embedding. jvz. // ---------------------------------------------------------------------- - System.setProperty( name, value ); + System.setProperty(name, value); } private Options options; - public Options buildDefaultCliOptions() - { + public Options buildDefaultCliOptions() { options = new Options(); - options.addOption( - OptionBuilder.withLongOpt( "define" ).hasArg().withDescription( "Define a system property" ).create( - SET_SYSTEM_PROPERTY ) ); - options.addOption( - OptionBuilder.withLongOpt( "help" ).withDescription( "Display help information" ).create( HELP ) ); - options.addOption( - OptionBuilder.withLongOpt( "version" ).withDescription( "Display version information" ).create( VERSION ) ); - options.addOption( - OptionBuilder.withLongOpt( "quiet" ).withDescription( "Quiet output - only show errors" ).create( QUIET ) ); - options.addOption( - OptionBuilder.withLongOpt( "debug" ).withDescription( "Produce execution debug output" ).create( DEBUG ) ); - options.addOption( - OptionBuilder.withLongOpt( "errors" ).withDescription( "Produce execution error messages" ).create( - ERRORS ) ); - - return buildCliOptions( options ); + options.addOption(OptionBuilder.withLongOpt("define") + .hasArg() + .withDescription("Define a system property") + .create(SET_SYSTEM_PROPERTY)); + options.addOption(OptionBuilder.withLongOpt("help") + .withDescription("Display help information") + .create(HELP)); + options.addOption(OptionBuilder.withLongOpt("version") + .withDescription("Display version information") + .create(VERSION)); + options.addOption(OptionBuilder.withLongOpt("quiet") + .withDescription("Quiet output - only show errors") + .create(QUIET)); + options.addOption(OptionBuilder.withLongOpt("debug") + .withDescription("Produce execution debug output") + .create(DEBUG)); + options.addOption(OptionBuilder.withLongOpt("errors") + .withDescription("Produce execution error messages") + .create(ERRORS)); + + return buildCliOptions(options); } - public CommandLine parse( String[] args ) - throws ParseException - { + public CommandLine parse(String[] args) throws ParseException { // We need to eat any quotes surrounding arguments... - String[] cleanArgs = cleanArgs( args ); + String[] cleanArgs = cleanArgs(args); CommandLineParser parser = new GnuParser(); - return parser.parse( buildDefaultCliOptions(), cleanArgs ); + return parser.parse(buildDefaultCliOptions(), cleanArgs); } - private static String[] cleanArgs( String[] args ) - { + private static String[] cleanArgs(String[] args) { List cleaned = new ArrayList(); StringBuffer currentArg = null; - for ( int i = 0; i < args.length; i++ ) - { + for (int i = 0; i < args.length; i++) { String arg = args[i]; boolean addedToBuffer = false; - if ( arg.startsWith( "\"" ) ) - { + if (arg.startsWith("\"")) { // if we're in the process of building up another arg, push it and start over. // this is for the case: "-Dfoo=bar "-Dfoo2=bar two" (note the first unterminated quote) - if ( currentArg != null ) - { - cleaned.add( currentArg.toString() ); + if (currentArg != null) { + cleaned.add(currentArg.toString()); } // start building an argument here. - currentArg = new StringBuffer( arg.substring( 1 ) ); + currentArg = new StringBuffer(arg.substring(1)); addedToBuffer = true; } // this has to be a separate "if" statement, to capture the case of: "-Dfoo=bar" - if ( arg.endsWith( "\"" ) ) - { - String cleanArgPart = arg.substring( 0, arg.length() - 1 ); + if (arg.endsWith("\"")) { + String cleanArgPart = arg.substring(0, arg.length() - 1); // if we're building an argument, keep doing so. - if ( currentArg != null ) - { + if (currentArg != null) { // if this is the case of "-Dfoo=bar", then we need to adjust the buffer. - if ( addedToBuffer ) - { - currentArg.setLength( currentArg.length() - 1 ); + if (addedToBuffer) { + currentArg.setLength(currentArg.length() - 1); } // otherwise, we trim the trailing " and append to the buffer. - else - { + else { // TODO: introducing a space here...not sure what else to do but collapse whitespace - currentArg.append( ' ' ).append( cleanArgPart ); + currentArg.append(' ').append(cleanArgPart); } // we're done with this argument, so add it. - cleaned.add( currentArg.toString() ); - } - else - { + cleaned.add(currentArg.toString()); + } else { // this is a simple argument...just add it. - cleaned.add( cleanArgPart ); + cleaned.add(cleanArgPart); } // the currentArg MUST be finished when this completes. @@ -438,49 +372,41 @@ private static String[] cleanArgs( String[] args ) // buffer, then append it with a preceding space...again, not sure what else to // do other than collapse whitespace. // NOTE: The case of a trailing quote is handled by nullifying the arg buffer. - if ( !addedToBuffer ) - { + if (!addedToBuffer) { // append to the argument we're building, collapsing whitespace to a single space. - if ( currentArg != null ) - { - currentArg.append( ' ' ).append( arg ); + if (currentArg != null) { + currentArg.append(' ').append(arg); } // this is a loner, just add it directly. - else - { - cleaned.add( arg ); + else { + cleaned.add(arg); } } } // clean up. - if ( currentArg != null ) - { - cleaned.add( currentArg.toString() ); + if (currentArg != null) { + cleaned.add(currentArg.toString()); } int cleanedSz = cleaned.size(); String[] cleanArgs = null; - if ( cleanedSz == 0 ) - { + if (cleanedSz == 0) { // if we didn't have any arguments to clean, simply pass the original array through cleanArgs = args; - } - else - { - cleanArgs = (String[]) cleaned.toArray( new String[cleanedSz] ); + } else { + cleanArgs = (String[]) cleaned.toArray(new String[cleanedSz]); } return cleanArgs; } - public void displayHelp() - { + public void displayHelp() { System.out.println(); HelpFormatter formatter = new HelpFormatter(); - formatter.printHelp( "mvn [options] [] []", "\nOptions:", options, "\n" ); + formatter.printHelp("mvn [options] [] []", "\nOptions:", options, "\n"); } } diff --git a/src/main/java/org/codehaus/plexus/tools/cli/Cli.java b/src/main/java/org/codehaus/plexus/tools/cli/Cli.java index 6f5fddf..640a9d1 100644 --- a/src/main/java/org/codehaus/plexus/tools/cli/Cli.java +++ b/src/main/java/org/codehaus/plexus/tools/cli/Cli.java @@ -16,20 +16,17 @@ * limitations under the License. */ -import org.codehaus.plexus.PlexusContainer; -import org.apache.commons.cli.Options; import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Options; +import org.codehaus.plexus.PlexusContainer; /** * @author Jason van Zyl */ -public interface Cli -{ - Options buildCliOptions( Options options ); +public interface Cli { + Options buildCliOptions(Options options); - void invokePlexusComponent( CommandLine cli, - PlexusContainer container ) - throws Exception; + void invokePlexusComponent(CommandLine cli, PlexusContainer container) throws Exception; // this can be calculated String getPomPropertiesPath(); diff --git a/src/test/java/org/codehaus/plexus/tools/cli/CliTest.java b/src/test/java/org/codehaus/plexus/tools/cli/CliTest.java index 6a44160..4625d29 100644 --- a/src/test/java/org/codehaus/plexus/tools/cli/CliTest.java +++ b/src/test/java/org/codehaus/plexus/tools/cli/CliTest.java @@ -16,40 +16,34 @@ * limitations under the License. */ -import org.codehaus.plexus.PlexusTestCase; -import org.codehaus.plexus.util.FileUtils; - +import java.io.File; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.io.File; + +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.util.FileUtils; /** * @author Jason van Zyl */ -public class CliTest - extends PlexusTestCase -{ - public void testCli() - throws Exception - { - String[] args = new String[]{"-n", getBasedir()}; +public class CliTest extends PlexusTestCase { + public void testCli() throws Exception { + String[] args = new String[] {"-n", getBasedir()}; Class clazz = TestCli.class; - Method m = clazz.getMethod( "main", new Class[]{String[].class} ); + Method m = clazz.getMethod("main", new Class[] {String[].class}); int modifiers = m.getModifiers(); - if ( Modifier.isStatic( modifiers ) && Modifier.isPublic( modifiers ) ) - { - if ( m.getReturnType() == Integer.TYPE || m.getReturnType() == Void.TYPE ) - { - m.invoke( clazz, new Object[]{args} ); + if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers)) { + if (m.getReturnType() == Integer.TYPE || m.getReturnType() == Void.TYPE) { + m.invoke(clazz, new Object[] {args}); } } - String s = FileUtils.fileRead( new File( getBasedir(), "target/cli.txt" ) ); + String s = FileUtils.fileRead(new File(getBasedir(), "target/cli.txt")); - assertEquals( "NAME_OPTION_INVOKED", s ); + assertEquals("NAME_OPTION_INVOKED", s); } } diff --git a/src/test/java/org/codehaus/plexus/tools/cli/TestCli.java b/src/test/java/org/codehaus/plexus/tools/cli/TestCli.java index 35b1a31..90f487c 100644 --- a/src/test/java/org/codehaus/plexus/tools/cli/TestCli.java +++ b/src/test/java/org/codehaus/plexus/tools/cli/TestCli.java @@ -16,45 +16,38 @@ * limitations under the License. */ -import org.codehaus.plexus.PlexusContainer; -import org.codehaus.plexus.util.FileUtils; -import org.apache.commons.cli.Options; +import java.io.File; + import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.OptionBuilder; - -import java.io.File; +import org.apache.commons.cli.Options; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.util.FileUtils; /** * @author Jason van Zyl */ -public class TestCli - extends AbstractCli -{ - public static void main( String[] args ) - throws Exception - { - new TestCli().execute( args ); +public class TestCli extends AbstractCli { + public static void main(String[] args) throws Exception { + new TestCli().execute(args); } - public Options buildCliOptions( Options options ) - { - options.addOption( - OptionBuilder.withLongOpt( "name" ).withDescription( "Display name." ).hasArg().create( 'n' ) ); + public Options buildCliOptions(Options options) { + options.addOption(OptionBuilder.withLongOpt("name") + .withDescription("Display name.") + .hasArg() + .create('n')); return options; } - public void invokePlexusComponent( CommandLine cli, - PlexusContainer container ) - throws Exception - { - if ( cli.hasOption( 'n' ) ) - { - String directory = cli.getOptionValue( 'n' ); + public void invokePlexusComponent(CommandLine cli, PlexusContainer container) throws Exception { + if (cli.hasOption('n')) { + String directory = cli.getOptionValue('n'); - FileUtils.mkdir( new File( directory, "target" ).getAbsolutePath() ); + FileUtils.mkdir(new File(directory, "target").getAbsolutePath()); - FileUtils.fileWrite( new File( directory, "target/cli.txt").getAbsolutePath() , "NAME_OPTION_INVOKED" ); + FileUtils.fileWrite(new File(directory, "target/cli.txt").getAbsolutePath(), "NAME_OPTION_INVOKED"); } } } From ec8f9fac7be97c91bbde69440eb0efef446b4dae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 05:45:10 +0000 Subject: [PATCH 36/42] Bump commons-cli:commons-cli from 1.5.0 to 1.6.0 Bumps commons-cli:commons-cli from 1.5.0 to 1.6.0. --- updated-dependencies: - dependency-name: commons-cli:commons-cli dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b5ed889..95c04ba 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ commons-cli commons-cli - 1.5.0 + 1.6.0 From da0d0e5fe82168131765b2803be03c3e593ffffb Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sat, 2 Dec 2023 10:38:52 +0100 Subject: [PATCH 37/42] Reuse plexus-pom action for CI --- .github/workflows/maven.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d2e5d8f..09feae4 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -14,15 +14,18 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -name: Java CI -on: - push: - branches-ignore: - - dependabot/** - pull_request: +name: GitHub CI + +on: [push, pull_request] jobs: build: - name: Verify - uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3 + name: Build it + uses: codehaus-plexus/.github/.github/workflows/maven.yml@master + + deploy: + name: Deploy + needs: build + uses: codehaus-plexus/.github/.github/workflows/maven-deploy.yml@master + secrets: inherit From caccdb677548fadb85e5a991546e442815a1329d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 05:56:30 +0000 Subject: [PATCH 38/42] Bump org.codehaus.plexus:plexus from 15 to 16 Bumps [org.codehaus.plexus:plexus](https://github.com/codehaus-plexus/plexus-pom) from 15 to 16. - [Release notes](https://github.com/codehaus-plexus/plexus-pom/releases) - [Commits](https://github.com/codehaus-plexus/plexus-pom/commits) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 95c04ba..4466ef5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.codehaus.plexus plexus - 15 + 16 plexus-cli From fe501abc1292c2b8ef8fee4e58350a1fd9a77610 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Tue, 12 Dec 2023 03:20:44 +0100 Subject: [PATCH 39/42] Replace plexus-container-default with Sisu Plexus --- pom.xml | 17 ++++++++++++++--- .../org/codehaus/plexus/tools/cli/CliTest.java | 10 +++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 4466ef5..eef9b1d 100644 --- a/pom.xml +++ b/pom.xml @@ -37,9 +37,9 @@ - org.codehaus.plexus - plexus-container-default - 2.1.1 + org.eclipse.sisu + org.eclipse.sisu.plexus + 0.3.5 org.codehaus.plexus @@ -56,6 +56,17 @@ commons-cli 1.6.0 + + org.junit.jupiter + junit-jupiter-api + test + + + org.codehaus.plexus + plexus-testing + 1.2.0 + test + diff --git a/src/test/java/org/codehaus/plexus/tools/cli/CliTest.java b/src/test/java/org/codehaus/plexus/tools/cli/CliTest.java index 4625d29..b4db53d 100644 --- a/src/test/java/org/codehaus/plexus/tools/cli/CliTest.java +++ b/src/test/java/org/codehaus/plexus/tools/cli/CliTest.java @@ -20,14 +20,18 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.FileUtils; +import org.junit.jupiter.api.Test; + +import static org.codehaus.plexus.testing.PlexusExtension.getBasedir; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author Jason van Zyl */ -public class CliTest extends PlexusTestCase { - public void testCli() throws Exception { +class CliTest { + @Test + void cli() throws Exception { String[] args = new String[] {"-n", getBasedir()}; Class clazz = TestCli.class; From 28bc42818a9f5cbcff5d6eaacadef53d819ded44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 05:31:21 +0000 Subject: [PATCH 40/42] Bump org.codehaus.plexus:plexus-testing from 1.2.0 to 1.3.0 Bumps [org.codehaus.plexus:plexus-testing](https://github.com/codehaus-plexus/plexus-testing) from 1.2.0 to 1.3.0. - [Release notes](https://github.com/codehaus-plexus/plexus-testing/releases) - [Commits](https://github.com/codehaus-plexus/plexus-testing/compare/plexus-testing-1.2.0...plexus-testing-1.3.0) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus-testing dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eef9b1d..1b123c0 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ org.codehaus.plexus plexus-testing - 1.2.0 + 1.3.0 test From 0131384b89daf1f91b5b194445e4d5515f2d05aa Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sun, 17 Dec 2023 12:11:20 +0100 Subject: [PATCH 41/42] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f4401b0..5a5250d 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,5 @@ Plexus-CLI [![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/codehaus-plexus/plexus-cli.svg?label=License)](http://www.apache.org/licenses/) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-cli.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-cli) -[![Build Status](https://travis-ci.org/codehaus-plexus/plexus-cli.svg?branch=master)](https://travis-ci.org/codehaus-plexus/plexus-cli) The canonical git repository is located at https://github.com/codehaus-plexus/plexus-cli From dc5e553da92a42cf2e16e21971acc718ea18b311 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sat, 23 Dec 2023 22:44:18 +0100 Subject: [PATCH 42/42] [maven-release-plugin] prepare release plexus-cli-1.7 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 1b123c0..bda976d 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ plexus-cli - 1.7-SNAPSHOT + 1.7 Plexus CLI Easily create CLIs with Plexus components @@ -17,7 +17,7 @@ scm:git:https://github.com/codehaus-plexus/plexus-cli.git scm:git:https://github.com/codehaus-plexus/plexus-cli.git - HEAD + plexus-cli-1.7 https://github.com/codehaus-plexus/plexus-cli/tree/${project.scm.tag}/ @@ -32,7 +32,7 @@ - 2020-01-20T18:52:37Z + 2023-12-23T21:44:13Z