From 753a6c60f47f3ac4f270005b65e9d6481de8eb68 Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 23 Oct 2015 10:00:02 -0700 Subject: Adding maven and ant source trees Change-Id: I0a39b9add833a31b9c3f98d193983ae2f3a5a445 Signed-off-by: Ashlee Young --- .../apache-maven-3.3.3/maven-embedder/pom.xml | 144 ++ .../src/examples/simple-project/pom.xml | 39 + .../src/examples/simple-project/settings.xml | 26 + .../main/java/org/apache/maven/embedder/App.java | 28 + .../java/org/apache/maven/embedder/AppTest.java | 53 + .../main/java/org/apache/maven/cli/CLIManager.java | 271 ++++ .../org/apache/maven/cli/CLIReportingUtils.java | 205 +++ .../main/java/org/apache/maven/cli/CliRequest.java | 120 ++ .../main/java/org/apache/maven/cli/MavenCli.java | 1610 ++++++++++++++++++++ .../cli/configuration/ConfigurationProcessor.java | 28 + .../SettingsXmlConfigurationProcessor.java | 290 ++++ .../maven/cli/event/DefaultEventSpyContext.java | 38 + .../maven/cli/event/ExecutionEventLogger.java | 381 +++++ .../internal/BootstrapCoreExtensionManager.java | 143 ++ .../maven/cli/logging/BaseSlf4jConfiguration.java | 45 + .../maven/cli/logging/Slf4jConfiguration.java | 47 + .../cli/logging/Slf4jConfigurationFactory.java | 91 ++ .../org/apache/maven/cli/logging/Slf4jLogger.java | 145 ++ .../maven/cli/logging/Slf4jLoggerManager.java | 111 ++ .../maven/cli/logging/Slf4jStdoutLogger.java | 306 ++++ .../cli/logging/impl/Log4j2Configuration.java | 59 + .../cli/logging/impl/LogbackConfiguration.java | 61 + .../cli/logging/impl/Slf4jSimpleConfiguration.java | 63 + .../impl/UnsupportedSlf4jBindingConfiguration.java | 72 + .../transfer/AbstractMavenTransferListener.java | 90 ++ .../transfer/BatchModeMavenTransferListener.java | 32 + .../cli/transfer/ConsoleMavenTransferListener.java | 133 ++ .../cli/transfer/QuietMavenTransferListener.java | 31 + .../cli/transfer/Slf4jMavenTransferListener.java | 97 ++ .../src/main/java/org/slf4j/MavenSlf4jFriend.java | 35 + .../org/slf4j/impl/MavenSlf4jSimpleFriend.java | 40 + .../src/main/mdo/core-extensions.mdo | 88 ++ .../src/main/resources/META-INF/MANIFEST.MF | 7 + .../META-INF/maven/slf4j-configuration.properties | 22 + .../maven-embedder/src/site/apt/cli.apt.vm | 28 + .../maven-embedder/src/site/apt/index.apt.vm | 42 + .../maven-embedder/src/site/apt/logging.apt | 112 ++ .../maven-embedder/src/site/site.xml | 40 + .../src/test/embedder-test-project/pom.xml | 48 + .../src/main/java/org/apache/maven/App.java | 13 + .../src/test/java/org/apache/maven/AppTest.java | 38 + .../aggregate-mojo-failure/plugin/pom.xml | 49 + .../src/main/java/org/plugin/TestPlugin.java | 36 + .../aggregate-mojo-failure/project/pom.xml | 25 + .../bad-build-plan/plugin/pom.xml | 49 + .../src/main/java/org/plugin/TestPlugin.java | 35 + .../bad-build-plan/project/pom.xml | 25 + .../bad-dep-version/pom.xml | 33 + .../test-maven-ext/1/test-maven-ext-1.pom | 34 + .../bad-ext-direct-deps/project/pom.xml | 35 + .../1/bad-ext-plugin-dep-ver-maven-plugin-1.jar | Bin 0 -> 3166 bytes .../1/bad-ext-plugin-dep-ver-maven-plugin-1.pom | 55 + .../bad-ext-plugin-dep-ver/plugin/pom.xml | 57 + .../src/main/java/org/plugin/TestPlugin.java | 33 + .../bad-ext-plugin-dep-ver/project/pom.xml | 37 + .../1/bad-ext-plugin-maven-ver-maven-plugin-1.jar | Bin 0 -> 3166 bytes .../1/bad-ext-plugin-maven-ver-maven-plugin-1.pom | 54 + .../maven-metadata-local.xml | 12 + .../bad-ext-plugin-maven-ver/plugin/pom.xml | 57 + .../src/main/java/org/plugin/TestPlugin.java | 33 + .../bad-ext-plugin-maven-ver/project/pom.xml | 37 + .../bad-maven-version/pom.xml | 11 + .../bad-mg-dep-version/pom.xml | 35 + .../bad-non-dep-version/pom.xml | 35 + .../bad-profile-repo/pom.xml | 7 + .../bad-profile-repo/profiles.xml | 18 + .../config-rdonly-mojo-param/plugin/pom.xml | 49 + .../src/main/java/org/plugin/TestPlugin.java | 39 + .../config-rdonly-mojo-param/project/pom.xml | 47 + .../deploy-repo-creation-err/pom.xml | 41 + .../duplicated-attachments/plugin/pom.xml | 54 + .../src/main/java/org/plugin/TestPlugin.java | 50 + .../duplicated-attachments/project/pom.xml | 25 + .../1/err-loading-plugin-maven-plugin-1.jar | Bin 0 -> 3166 bytes .../1/err-loading-plugin-maven-plugin-1.pom | 55 + .../err-loading-plugin/project/pom.xml | 45 + .../org/apache/maven/errortest/dep/1/dep-1.pom | 16 + .../1/err-resolving-ext-plugin-maven-plugin-1.jar | Bin 0 -> 3166 bytes .../1/err-resolving-ext-plugin-maven-plugin-1.pom | 60 + .../err-resolving-ext-plugin/project/pom.xml | 18 + .../org/apache/maven/errortest/dep/1/dep-1.pom | 16 + .../err-resolving-project-dep/project/pom.xml | 27 + .../apache/maven/test/error/mojoFailure/App.java | 13 + .../maven/test/error/mojoFailure/AppTest.java | 38 + .../test-maven-ext-dep/1/test-maven-ext-dep-1.pom | 26 + .../test-maven-ext/1/test-maven-ext-1.pom | 34 + .../ext-deps-resolve-err/project/pom.xml | 35 + .../ext-plugin-artifact-missing-maven-plugin-1.pom | 55 + .../ext-plugin-artifact-missing/project/pom.xml | 37 + .../ext-plugin-realm-error/plugin/pom.xml | 49 + .../src/main/java/org/plugin/ComponentOne.java | 8 + .../src/main/java/org/plugin/ComponentTwo.java | 8 + .../src/main/java/org/plugin/TestPlugin.java | 39 + .../main/resources/META-INF/plexus/components.xml | 25 + .../ext-plugin-realm-error/project/pom.xml | 36 + .../1/ext-plugin-version-err-maven-plugin-1.jar | Bin 0 -> 3166 bytes .../1/ext-plugin-version-err-maven-plugin-1.pom | 50 + .../maven-metadata-local.xml | 10 + .../ext-plugin-version-err/plugin/pom.xml | 57 + .../src/main/java/org/plugin/TestPlugin.java | 33 + .../ext-plugin-version-err/project/pom.xml | 36 + .../ext-realm-error/ext/pom.xml | 38 + .../ext/src/main/java/org/ext/App.java | 13 + .../main/resources/META-INF/plexus/components.xml | 1 + .../ext-realm-error/project/pom.xml | 35 + .../interp-from-model/pom.xml | 7 + .../local-repo/org/test/bad-pom/1/bad-pom-1.pom | 9 + .../interp-from-project/project/pom.xml | 22 + .../load-extern-profiles-ioex/pom.xml | 7 + .../load-extern-profiles-xex/pom.xml | 7 + .../load-extern-profiles-xex/profiles.xml | 4 + .../missing-direct-invoke-mojo/plugin/pom.xml | 49 + .../src/main/java/org/plugin/TestPlugin.java | 36 + .../missing-module-pom/child1/pom.xml | 19 + .../child1/src/main/java/org/test/App.java | 13 + .../child1/src/test/java/org/test/AppTest.java | 38 + .../missing-module-pom/pom.xml | 13 + .../missing-parent-pom/pom.xml | 11 + .../missing-req-mojo-param/plugin/pom.xml | 49 + .../src/main/java/org/plugin/TestPlugin.java | 38 + .../missing-req-mojo-param/project/pom.xml | 25 + .../mojo-config-error/plugin/pom.xml | 49 + .../src/main/java/org/plugin/TestPlugin.java | 33 + .../src/main/resources/META-INF/maven/plugin.xml | 38 + .../mojo-config-error/project/pom.xml | 45 + .../mojo-exec-err/plugin/pom.xml | 49 + .../src/main/java/org/plugin/TestPlugin.java | 33 + .../mojo-exec-err/project/pom.xml | 26 + .../mojo-lookup-err/plugin/pom.xml | 54 + .../src/main/java/org/plugin/TestPlugin.java | 42 + .../mojo-lookup-err/project/pom.xml | 25 + .../parent-parse-ioex/child/pom.xml | 10 + .../parent-parse-ioex/pom.xml | 0 .../parent-parse-xex/child/pom.xml | 10 + .../parent-parse-xex/pom.xml | 7 + .../profile-activator-err/pom.xml | 39 + .../profile-activator-lookup-err/ext/pom.xml | 38 + .../ext/src/main/java/org/ext/App.java | 13 + .../main/resources/META-INF/plexus/components.xml | 16 + .../profile-activator-lookup-err/project/pom.xml | 46 + .../project-collision/mod1/pom.xml | 7 + .../project-collision/mod2/pom.xml | 7 + .../project-collision/pom.xml | 12 + .../project-cycle/dep/pom.xml | 12 + .../error-reporting-projects/project-cycle/pom.xml | 19 + .../project-dep-missing/pom.xml | 22 + .../apache/maven/test/error/mojoFailure/App.java | 13 + .../maven/test/error/mojoFailure/AppTest.java | 38 + .../project-mojo-failure/pom.xml | 17 + .../apache/maven/test/error/mojoFailure/App.java | 14 + .../maven/test/error/mojoFailure/AppTest.java | 38 + .../project-parse-xex/pom.xml | 25 + .../project-validation/pom.xml | 13 + .../repo-creation-err/pom.xml | 41 + .../test/eventing-projects/read-with-deps/pom.xml | 15 + .../read-with-deps/repo/tests/dep/1/dep-1.pom | 6 + .../eventing-projects/simple-read-project/pom.xml | 6 + .../test/extensions/META-INF/plexus/components.xml | 28 + .../java/org/apache/maven/cli/CLIManagerTest.java | 108 ++ .../apache/maven/cli/CLIReportingUtilsTest.java | 40 + .../java/org/apache/maven/cli/MavenCliTest.java | 110 ++ .../src/test/plugin-version-references/jar-pom.xml | 32 + .../plugin-version-references/maven-plugin-pom.xml | 36 + .../bad-module-non-recursive/badmodule/pom.xml | 14 + .../bad-module-non-recursive/goodmodule/pom.xml | 14 + .../test/projects/bad-module-non-recursive/pom.xml | 14 + .../test/projects/config-illegal/.mvn/maven.config | 1 + .../src/test/projects/config/.mvn/maven.config | 2 + .../src/test/projects/invalid-goal/pom.xml | 49 + .../project/pom.xml | 13 + .../src/main/java/org/codehaus/m2eclipse/App.java | 13 + .../test/java/org/codehaus/m2eclipse/AppTest.java | 38 + .../parent/1.0-SNAPSHOT/maven-metadata-company.xml | 11 + .../parent/1.0-SNAPSHOT/parent-1.0-SNAPSHOT.pom | 18 + .../m2eclipse/parent/maven-metadata-local.xml | 11 + .../settings.xml | 23 + .../src/test/projects/optional-dep/pom.xml | 20 + .../readProject-missingModuleIgnored/pom.xml | 13 + .../modules/child1/pom.xml | 13 + .../readProject-withScmInheritance/pom.xml | 19 + .../org.apache.maven/maven-core/pom.properties | 18 + .../resources/pom-with-distribution-status.xml | 30 + .../test/resources/pom-without-dependencies.xml | 30 + .../maven-embedder/src/test/resources/pom.xml | 34 + .../maven-embedder/src/test/resources/pom2.xml | 48 + .../test/resources/settings/invalid-settings.xml | 24 + .../src/test/resources/settings/valid-settings.xml | 27 + 187 files changed, 9368 insertions(+) create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/settings.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/src/main/java/org/apache/maven/embedder/App.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/src/test/java/org/apache/maven/embedder/AppTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CliRequest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/configuration/ConfigurationProcessor.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/event/DefaultEventSpyContext.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/BaseSlf4jConfiguration.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jConfiguration.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jConfigurationFactory.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLogger.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLoggerManager.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jStdoutLogger.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Log4j2Configuration.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/BatchModeMavenTransferListener.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/QuietMavenTransferListener.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/Slf4jMavenTransferListener.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/slf4j/MavenSlf4jFriend.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/mdo/core-extensions.mdo create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/resources/META-INF/MANIFEST.MF create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/cli.apt.vm create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/index.apt.vm create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/logging.apt create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/site.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/src/main/java/org/apache/maven/App.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/src/test/java/org/apache/maven/AppTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-dep-version/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-direct-deps/local-repo/org/apache/maven/errortest/test-maven-ext/1/test-maven-ext-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-direct-deps/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-dep-ver-maven-plugin/1/bad-ext-plugin-dep-ver-maven-plugin-1.jar create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-dep-ver-maven-plugin/1/bad-ext-plugin-dep-ver-maven-plugin-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/1/bad-ext-plugin-maven-ver-maven-plugin-1.jar create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/1/bad-ext-plugin-maven-ver-maven-plugin-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/maven-metadata-local.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-maven-version/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-mg-dep-version/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-non-dep-version/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-profile-repo/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-profile-repo/profiles.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/deploy-repo-creation-err/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/local-repo/org/apache/maven/errortest/err-loading-plugin-maven-plugin/1/err-loading-plugin-maven-plugin-1.jar create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/local-repo/org/apache/maven/errortest/err-loading-plugin-maven-plugin/1/err-loading-plugin-maven-plugin-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/dep/1/dep-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/err-resolving-ext-plugin-maven-plugin/1/err-resolving-ext-plugin-maven-plugin-1.jar create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/err-resolving-ext-plugin-maven-plugin/1/err-resolving-ext-plugin-maven-plugin-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/local-repo/org/apache/maven/errortest/dep/1/dep-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/src/main/java/org/apache/maven/test/error/mojoFailure/App.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/local-repo/org/apache/maven/errortest/test-maven-ext-dep/1/test-maven-ext-dep-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/local-repo/org/apache/maven/errortest/test-maven-ext/1/test-maven-ext-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-artifact-missing/local-repo/org/apache/maven/errortest/ext-plugin-artifact-missing-maven-plugin/1/ext-plugin-artifact-missing-maven-plugin-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-artifact-missing/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/ComponentOne.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/ComponentTwo.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/resources/META-INF/plexus/components.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/1/ext-plugin-version-err-maven-plugin-1.jar create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/1/ext-plugin-version-err-maven-plugin-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/maven-metadata-local.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/src/main/java/org/ext/App.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/src/main/resources/META-INF/plexus/components.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-model/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-project/project/local-repo/org/test/bad-pom/1/bad-pom-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-project/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-ioex/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-xex/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-xex/profiles.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-direct-invoke-mojo/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-direct-invoke-mojo/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/src/main/java/org/test/App.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/src/test/java/org/test/AppTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-parent-pom/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/src/main/resources/META-INF/maven/plugin.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/plugin/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/plugin/src/main/java/org/plugin/TestPlugin.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-ioex/child/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-ioex/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-xex/child/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-xex/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-err/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/src/main/java/org/ext/App.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/src/main/resources/META-INF/plexus/components.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/mod1/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/mod2/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-cycle/dep/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-cycle/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/src/main/java/org/apache/maven/test/error/mojoFailure/App.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/src/main/java/org/apache/maven/test/error/mojoFailure/App.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-parse-xex/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-validation/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/repo-creation-err/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/read-with-deps/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/read-with-deps/repo/tests/dep/1/dep-1.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/simple-read-project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/extensions/META-INF/plexus/components.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/java/org/apache/maven/cli/CLIReportingUtilsTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/plugin-version-references/jar-pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/plugin-version-references/maven-plugin-pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/bad-module-non-recursive/badmodule/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/bad-module-non-recursive/goodmodule/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/bad-module-non-recursive/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/config-illegal/.mvn/maven.config create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/config/.mvn/maven.config create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/invalid-goal/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/isolated-project-getting-parent-pom/project/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/isolated-project-getting-parent-pom/project/src/main/java/org/codehaus/m2eclipse/App.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/isolated-project-getting-parent-pom/project/src/test/java/org/codehaus/m2eclipse/AppTest.java create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/isolated-project-getting-parent-pom/repository/org/codehaus/m2eclipse/parent/1.0-SNAPSHOT/maven-metadata-company.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/isolated-project-getting-parent-pom/repository/org/codehaus/m2eclipse/parent/1.0-SNAPSHOT/parent-1.0-SNAPSHOT.pom create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/isolated-project-getting-parent-pom/repository/org/codehaus/m2eclipse/parent/maven-metadata-local.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/isolated-project-getting-parent-pom/settings.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/optional-dep/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/readProject-missingModuleIgnored/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/readProject-withScmInheritance/modules/child1/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/projects/readProject-withScmInheritance/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/resources/META-INF/maven/org.apache.maven/maven-core/pom.properties create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/resources/pom-with-distribution-status.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/resources/pom-without-dependencies.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/resources/pom.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/resources/pom2.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/resources/settings/invalid-settings.xml create mode 100644 framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/resources/settings/valid-settings.xml (limited to 'framework/src/maven/apache-maven-3.3.3/maven-embedder') diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/pom.xml new file mode 100644 index 00000000..c004ea17 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/pom.xml @@ -0,0 +1,144 @@ + + + + + + 4.0.0 + + + org.apache.maven + maven + 3.3.3 + + + maven-embedder + + Maven Embedder + Maven embeddable component, with CLI and logging support. + + + scm:git:https://git-wip-us.apache.org/repos/asf/maven.git + scm:git:https://git-wip-us.apache.org/repos/asf/maven.git + maven-3.3.3 + + + + + org.apache.maven + maven-settings + + + org.apache.maven + maven-core + + + org.apache.maven + maven-plugin-api + + + org.apache.maven + maven-model-builder + + + org.apache.maven + maven-compat + runtime + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-classworlds + + + org.eclipse.sisu + org.eclipse.sisu.plexus + + + org.codehaus.plexus + plexus-component-annotations + + + org.sonatype.plexus + plexus-sec-dispatcher + + + org.sonatype.plexus + plexus-cipher + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-simple + true + + + ch.qos.logback + logback-classic + true + + + + commons-cli + commons-cli + + + + + + + src/main/resources + true + + + + + + org.apache.rat + apache-rat-plugin + + + src/main/resources/META-INF/MANIFEST.MF + src/test/*-projects/** + src/test/*-project/** + src/test/plugin-version-references/** + + + + + + + + org.eclipse.sisu + sisu-maven-plugin + + + org.codehaus.plexus + plexus-component-metadata + + + org.codehaus.modello + modello-maven-plugin + + 1.0.0 + + src/main/mdo/core-extensions.mdo + + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/pom.xml new file mode 100644 index 00000000..c4ad90d2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/pom.xml @@ -0,0 +1,39 @@ + + + + 4.0.0 + org.apache.maven.embedder + simple-project + 1.0-SNAPSHOT + simple-project + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + development + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/settings.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/settings.xml new file mode 100644 index 00000000..39709fde --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/settings.xml @@ -0,0 +1,26 @@ + + + + + + org.codehaus.tycho + org.sonatype.pwt + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/src/main/java/org/apache/maven/embedder/App.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/src/main/java/org/apache/maven/embedder/App.java new file mode 100644 index 00000000..06927bff --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/src/main/java/org/apache/maven/embedder/App.java @@ -0,0 +1,28 @@ +package org.apache.maven.embedder; + +/* + * 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. + */ + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/src/test/java/org/apache/maven/embedder/AppTest.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/src/test/java/org/apache/maven/embedder/AppTest.java new file mode 100644 index 00000000..ee90c206 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/examples/simple-project/src/test/java/org/apache/maven/embedder/AppTest.java @@ -0,0 +1,53 @@ +package org.apache.maven.embedder; + +/* + * 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. + */ + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java new file mode 100644 index 00000000..a78e11dc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java @@ -0,0 +1,271 @@ +package org.apache.maven.cli; + +/* + * 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. + */ + +import java.io.PrintStream; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.GnuParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.OptionBuilder; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; + +/** + * @author Jason van Zyl + */ +public class CLIManager +{ + public static final char ALTERNATE_POM_FILE = 'f'; + + public static final char BATCH_MODE = 'B'; + + public static final char SET_SYSTEM_PROPERTY = 'D'; + + public static final char OFFLINE = 'o'; + + public static final char QUIET = 'q'; + + public static final char DEBUG = 'X'; + + public static final char ERRORS = 'e'; + + public static final char HELP = 'h'; + + public static final char VERSION = 'v'; + + public static final char SHOW_VERSION = 'V'; + + public static final char NON_RECURSIVE = 'N'; + + public static final char UPDATE_SNAPSHOTS = 'U'; + + public static final char ACTIVATE_PROFILES = 'P'; + + public static final String SUPRESS_SNAPSHOT_UPDATES = "nsu"; + + public static final char CHECKSUM_FAILURE_POLICY = 'C'; + + public static final char CHECKSUM_WARNING_POLICY = 'c'; + + public static final char ALTERNATE_USER_SETTINGS = 's'; + + public static final String ALTERNATE_GLOBAL_SETTINGS = "gs"; + + public static final char ALTERNATE_USER_TOOLCHAINS = 't'; + + public static final String ALTERNATE_GLOBAL_TOOLCHAINS = "gt"; + + public static final String FAIL_FAST = "ff"; + + public static final String FAIL_AT_END = "fae"; + + public static final String FAIL_NEVER = "fn"; + + public static final String RESUME_FROM = "rf"; + + public static final String PROJECT_LIST = "pl"; + + public static final String ALSO_MAKE = "am"; + + public static final String ALSO_MAKE_DEPENDENTS = "amd"; + + public static final String LOG_FILE = "l"; + + public static final String ENCRYPT_MASTER_PASSWORD = "emp"; + + public static final String ENCRYPT_PASSWORD = "ep"; + + public static final String THREADS = "T"; + + public static final String LEGACY_LOCAL_REPOSITORY = "llr"; + + public static final String BUILDER = "b"; + + protected Options options; + + @SuppressWarnings( { "static-access", "checkstyle:linelength" } ) + public CLIManager() + { + options = new Options(); + options.addOption( OptionBuilder.withLongOpt( "help" ).withDescription( "Display help information" ).create( HELP ) ); + options.addOption( OptionBuilder.withLongOpt( "file" ).hasArg().withDescription( "Force the use of an alternate POM file (or directory with pom.xml)." ).create( ALTERNATE_POM_FILE ) ); + options.addOption( OptionBuilder.withLongOpt( "define" ).hasArg().withDescription( "Define a system property" ).create( SET_SYSTEM_PROPERTY ) ); + options.addOption( OptionBuilder.withLongOpt( "offline" ).withDescription( "Work offline" ).create( OFFLINE ) ); + 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 ) ); + options.addOption( OptionBuilder.withLongOpt( "non-recursive" ).withDescription( "Do not recurse into sub-projects" ).create( NON_RECURSIVE ) ); + options.addOption( OptionBuilder.withLongOpt( "update-snapshots" ).withDescription( "Forces a check for missing releases and updated snapshots on remote repositories" ).create( UPDATE_SNAPSHOTS ) ); + options.addOption( OptionBuilder.withLongOpt( "activate-profiles" ).withDescription( "Comma-delimited list of profiles to activate" ).hasArg().create( ACTIVATE_PROFILES ) ); + options.addOption( OptionBuilder.withLongOpt( "batch-mode" ).withDescription( "Run in non-interactive (batch) mode" ).create( BATCH_MODE ) ); + options.addOption( OptionBuilder.withLongOpt( "no-snapshot-updates" ).withDescription( "Suppress SNAPSHOT updates" ).create( SUPRESS_SNAPSHOT_UPDATES ) ); + options.addOption( OptionBuilder.withLongOpt( "strict-checksums" ).withDescription( "Fail the build if checksums don't match" ).create( CHECKSUM_FAILURE_POLICY ) ); + options.addOption( OptionBuilder.withLongOpt( "lax-checksums" ).withDescription( "Warn if checksums don't match" ).create( CHECKSUM_WARNING_POLICY ) ); + options.addOption( OptionBuilder.withLongOpt( "settings" ).withDescription( "Alternate path for the user settings file" ).hasArg().create( ALTERNATE_USER_SETTINGS ) ); + options.addOption( OptionBuilder.withLongOpt( "global-settings" ).withDescription( "Alternate path for the global settings file" ).hasArg().create( ALTERNATE_GLOBAL_SETTINGS ) ); + options.addOption( OptionBuilder.withLongOpt( "toolchains" ).withDescription( "Alternate path for the user toolchains file" ).hasArg().create( ALTERNATE_USER_TOOLCHAINS ) ); + options.addOption( OptionBuilder.withLongOpt( "global-toolchains" ).withDescription( "Alternate path for the global toolchains file" ).hasArg().create( ALTERNATE_GLOBAL_TOOLCHAINS ) ); + options.addOption( OptionBuilder.withLongOpt( "fail-fast" ).withDescription( "Stop at first failure in reactorized builds" ).create( FAIL_FAST ) ); + options.addOption( OptionBuilder.withLongOpt( "fail-at-end" ).withDescription( "Only fail the build afterwards; allow all non-impacted builds to continue" ).create( FAIL_AT_END ) ); + options.addOption( OptionBuilder.withLongOpt( "fail-never" ).withDescription( "NEVER fail the build, regardless of project result" ).create( FAIL_NEVER ) ); + options.addOption( OptionBuilder.withLongOpt( "resume-from" ).hasArg().withDescription( "Resume reactor from specified project" ).create( RESUME_FROM ) ); + options.addOption( OptionBuilder.withLongOpt( "projects" ).withDescription( "Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path." ).hasArg().create( PROJECT_LIST ) ); + options.addOption( OptionBuilder.withLongOpt( "also-make" ).withDescription( "If project list is specified, also build projects required by the list" ).create( ALSO_MAKE ) ); + options.addOption( OptionBuilder.withLongOpt( "also-make-dependents" ).withDescription( "If project list is specified, also build projects that depend on projects on the list" ).create( ALSO_MAKE_DEPENDENTS ) ); + options.addOption( OptionBuilder.withLongOpt( "log-file" ).hasArg().withDescription( "Log file to where all build output will go." ).create( LOG_FILE ) ); + options.addOption( OptionBuilder.withLongOpt( "show-version" ).withDescription( "Display version information WITHOUT stopping build" ).create( SHOW_VERSION ) ); + options.addOption( OptionBuilder.withLongOpt( "encrypt-master-password" ).hasOptionalArg().withDescription( "Encrypt master security password" ).create( ENCRYPT_MASTER_PASSWORD ) ); + options.addOption( OptionBuilder.withLongOpt( "encrypt-password" ).hasOptionalArg().withDescription( "Encrypt server password" ).create( ENCRYPT_PASSWORD ) ); + options.addOption( OptionBuilder.withLongOpt( "threads" ).hasArg().withDescription( "Thread count, for instance 2.0C where C is core multiplied" ).create( THREADS ) ); + options.addOption( OptionBuilder.withLongOpt( "legacy-local-repository" ).withDescription( "Use Maven 2 Legacy Local Repository behaviour, ie no use of _remote.repositories. Can also be activated by using -Dmaven.legacyLocalRepo=true" ).create( LEGACY_LOCAL_REPOSITORY ) ); + options.addOption( OptionBuilder.withLongOpt( "builder" ).hasArg().withDescription( "The id of the build strategy to use." ).create( BUILDER ) ); + + // Adding this back in for compatibility with the verifier that hard codes this option. + options.addOption( OptionBuilder.withLongOpt( "no-plugin-registry" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "npr" ) ); + options.addOption( OptionBuilder.withLongOpt( "check-plugin-updates" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "cpu" ) ); + options.addOption( OptionBuilder.withLongOpt( "update-plugins" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "up" ) ); + options.addOption( OptionBuilder.withLongOpt( "no-plugin-updates" ).withDescription( "Ineffective, only kept for backward compatibility" ).create( "npu" ) ); + } + + public CommandLine parse( String[] args ) + throws ParseException + { + // We need to eat any quotes surrounding arguments... + String[] cleanArgs = cleanArgs( args ); + + CommandLineParser parser = new GnuParser(); + + return parser.parse( options, cleanArgs ); + } + + private String[] cleanArgs( String[] args ) + { + List cleaned = new ArrayList(); + + StringBuilder currentArg = null; + + for ( String arg : args ) + { + boolean addedToBuffer = false; + + 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() ); + } + + // start building an argument here. + currentArg = new StringBuilder( 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 we're building an argument, keep doing so. + 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 ); + } + // otherwise, we trim the trailing " and append to the buffer. + else + { + // TODO: introducing a space here...not sure what else to do but collapse whitespace + currentArg.append( ' ' ).append( cleanArgPart ); + } + + cleaned.add( currentArg.toString() ); + } + else + { + cleaned.add( cleanArgPart ); + } + + currentArg = null; + + continue; + } + + // if we haven't added this arg to the buffer, and we ARE building an argument + // 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 ( currentArg != null ) + { + currentArg.append( ' ' ).append( arg ); + } + else + { + cleaned.add( arg ); + } + } + } + + if ( currentArg != null ) + { + cleaned.add( currentArg.toString() ); + } + + int cleanedSz = cleaned.size(); + + String[] cleanArgs; + + if ( cleanedSz == 0 ) + { + cleanArgs = args; + } + else + { + cleanArgs = cleaned.toArray( new String[cleanedSz] ); + } + + return cleanArgs; + } + + public void displayHelp( PrintStream stdout ) + { + stdout.println(); + + PrintWriter pw = new PrintWriter( stdout ); + + HelpFormatter formatter = new HelpFormatter(); + + formatter.printHelp( pw, HelpFormatter.DEFAULT_WIDTH, "mvn [options] [] []", "\nOptions:", + options, HelpFormatter.DEFAULT_LEFT_PAD, HelpFormatter.DEFAULT_DESC_PAD, "\n", false ); + + pw.flush(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java new file mode 100644 index 00000000..07863b72 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java @@ -0,0 +1,205 @@ +package org.apache.maven.cli; + +/* + * 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. + */ + +import java.io.IOException; +import java.io.InputStream; +import java.util.Date; +import java.util.Locale; +import java.util.Properties; +import java.util.TimeZone; + +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.Os; +import org.slf4j.Logger; + +/** + * Utility class used to report errors, statistics, application version info, etc. + * + * @author jdcasey + * + */ +public final class CLIReportingUtils +{ + // CHECKSTYLE_OFF: MagicNumber + public static final long MB = 1024 * 1024; + + private static final long ONE_SECOND = 1000L; + private static final long ONE_MINUTE = 60 * ONE_SECOND; + private static final long ONE_HOUR = 60 * ONE_MINUTE; + private static final long ONE_DAY = 24 * ONE_HOUR; + // CHECKSTYLE_ON: MagicNumber + + public static final String BUILD_VERSION_PROPERTY = "version"; + + public static String showVersion() + { + final String ls = System.getProperty( "line.separator" ); + Properties properties = getBuildProperties(); + StringBuilder version = new StringBuilder(); + version.append( createMavenVersionString( properties ) ).append( ls ); + version.append( reduce( properties.getProperty( "distributionShortName" ) + " home: " + + System.getProperty( "maven.home", "" ) ) ).append( ls ); + version.append( "Java version: " ).append( + System.getProperty( "java.version", "" ) ).append( ", vendor: " ).append( + System.getProperty( "java.vendor", "" ) ).append( ls ); + version.append( "Java home: " ).append( System.getProperty( "java.home", "" ) ).append( ls ); + version.append( "Default locale: " ).append( Locale.getDefault() ).append( ", platform encoding: " ).append( + System.getProperty( "file.encoding", "" ) ).append( ls ); + version.append( "OS name: \"" ).append( Os.OS_NAME ).append( "\", version: \"" ).append( Os.OS_VERSION ).append( + "\", arch: \"" ).append( Os.OS_ARCH ).append( "\", family: \"" ).append( Os.OS_FAMILY ).append( "\"" ); + return version.toString(); + } + + /** + * Create a human readable string containing the Maven version, buildnumber, and time of build + * + * @param buildProperties The build properties + * @return Readable build info + */ + static String createMavenVersionString( Properties buildProperties ) + { + String timestamp = reduce( buildProperties.getProperty( "timestamp" ) ); + String version = reduce( buildProperties.getProperty( BUILD_VERSION_PROPERTY ) ); + String rev = reduce( buildProperties.getProperty( "buildNumber" ) ); + String distributionName = reduce( buildProperties.getProperty( "distributionName" ) ); + + String msg = distributionName + " "; + msg += ( version != null ? version : "" ); + if ( rev != null || timestamp != null ) + { + msg += " ("; + msg += ( rev != null ? rev : "" ); + if ( timestamp != null ) + { + String ts = formatTimestamp( Long.valueOf( timestamp ) ); + msg += ( rev != null ? "; " : "" ) + ts; + } + msg += ")"; + } + return msg; + } + + private static String reduce( String s ) + { + return ( s != null ? ( s.startsWith( "${" ) && s.endsWith( "}" ) ? null : s ) : null ); + } + + static Properties getBuildProperties() + { + Properties properties = new Properties(); + InputStream resourceAsStream = null; + try + { + resourceAsStream = MavenCli.class.getResourceAsStream( "/org/apache/maven/messages/build.properties" ); + + if ( resourceAsStream != null ) + { + properties.load( resourceAsStream ); + } + } + catch ( IOException e ) + { + System.err.println( "Unable determine version from JAR file: " + e.getMessage() ); + } + finally + { + IOUtil.close( resourceAsStream ); + } + + return properties; + } + + public static void showError( Logger logger, String message, Throwable e, boolean showStackTrace ) + { + if ( showStackTrace ) + { + logger.error( message, e ); + } + else + { + logger.error( message ); + + if ( e != null ) + { + logger.error( e.getMessage() ); + + for ( Throwable cause = e.getCause(); cause != null; cause = cause.getCause() ) + { + logger.error( "Caused by: " + cause.getMessage() ); + } + } + } + } + + public static String formatTimestamp( long timestamp ) + { + // Manual construction of the tz offset because only Java 7 is aware of ISO 8601 time zones + TimeZone tz = TimeZone.getDefault(); + int offset = tz.getRawOffset(); + + // Raw offset ignores DST, so check if we are in DST now and add the offset + if ( tz.inDaylightTime( new Date( timestamp ) ) ) + { + offset += tz.getDSTSavings(); + } + + // CHECKSTYLE_OFF: MagicNumber + long m = Math.abs( ( offset / ONE_MINUTE ) % 60 ); + long h = Math.abs( ( offset / ONE_HOUR ) % 24 ); + // CHECKSTYLE_ON: MagicNumber + + int offsetDir = (int) Math.signum( (float) offset ); + char offsetSign = offsetDir >= 0 ? '+' : '-'; + return String.format( "%tFT% 0 ) + { + format = "%d d %02d:%02d h"; + } + else if ( h > 0 ) + { + format = "%2$02d:%3$02d h"; + } + else if ( m > 0 ) + { + format = "%3$02d:%4$02d min"; + } + else + { + format = "%4$d.%5$03d s"; + } + + return String.format( format, d, h, m, s, ms ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CliRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CliRequest.java new file mode 100644 index 00000000..4656dd37 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/CliRequest.java @@ -0,0 +1,120 @@ +package org.apache.maven.cli; + +/* + * 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. + */ + +import java.io.File; +import java.util.Properties; + +import org.apache.commons.cli.CommandLine; +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionRequest; +import org.codehaus.plexus.classworlds.ClassWorld; + +public class CliRequest +{ + String[] args; + + CommandLine commandLine; + + ClassWorld classWorld; + + String workingDirectory; + + File multiModuleProjectDirectory; + + boolean debug; + + boolean quiet; + + boolean showErrors = true; + + Properties userProperties = new Properties(); + + Properties systemProperties = new Properties(); + + MavenExecutionRequest request; + + CliRequest( String[] args, ClassWorld classWorld ) + { + this.args = args; + this.classWorld = classWorld; + this.request = new DefaultMavenExecutionRequest(); + } + + public String[] getArgs() + { + return args; + } + + public CommandLine getCommandLine() + { + return commandLine; + } + + public ClassWorld getClassWorld() + { + return classWorld; + } + + public String getWorkingDirectory() + { + return workingDirectory; + } + + public File getMultiModuleProjectDirectory() + { + return multiModuleProjectDirectory; + } + + public boolean isDebug() + { + return debug; + } + + public boolean isQuiet() + { + return quiet; + } + + public boolean isShowErrors() + { + return showErrors; + } + + public Properties getUserProperties() + { + return userProperties; + } + + public Properties getSystemProperties() + { + return systemProperties; + } + + public MavenExecutionRequest getRequest() + { + return request; + } + + public void setUserProperties( Properties properties ) + { + this.userProperties.putAll( properties ); + } +} \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java new file mode 100644 index 00000000..39660956 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -0,0 +1,1610 @@ +package org.apache.maven.cli; + +/* + * 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. + */ + +import java.io.BufferedInputStream; +import java.io.Console; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.Set; +import java.util.StringTokenizer; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.ParseException; +import org.apache.commons.cli.UnrecognizedOptionException; +import org.apache.maven.BuildAbort; +import org.apache.maven.InternalErrorException; +import org.apache.maven.Maven; +import org.apache.maven.building.FileSource; +import org.apache.maven.building.Problem; +import org.apache.maven.building.Source; +import org.apache.maven.cli.configuration.ConfigurationProcessor; +import org.apache.maven.cli.configuration.SettingsXmlConfigurationProcessor; +import org.apache.maven.cli.event.DefaultEventSpyContext; +import org.apache.maven.cli.event.ExecutionEventLogger; +import org.apache.maven.cli.internal.BootstrapCoreExtensionManager; +import org.apache.maven.cli.internal.extension.model.CoreExtension; +import org.apache.maven.cli.internal.extension.model.io.xpp3.CoreExtensionsXpp3Reader; +import org.apache.maven.cli.logging.Slf4jConfiguration; +import org.apache.maven.cli.logging.Slf4jConfigurationFactory; +import org.apache.maven.cli.logging.Slf4jLoggerManager; +import org.apache.maven.cli.logging.Slf4jStdoutLogger; +import org.apache.maven.cli.transfer.ConsoleMavenTransferListener; +import org.apache.maven.cli.transfer.QuietMavenTransferListener; +import org.apache.maven.cli.transfer.Slf4jMavenTransferListener; +import org.apache.maven.eventspy.internal.EventSpyDispatcher; +import org.apache.maven.exception.DefaultExceptionHandler; +import org.apache.maven.exception.ExceptionHandler; +import org.apache.maven.exception.ExceptionSummary; +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.ExecutionListener; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionRequestPopulationException; +import org.apache.maven.execution.MavenExecutionRequestPopulator; +import org.apache.maven.execution.MavenExecutionResult; +import org.apache.maven.extension.internal.CoreExports; +import org.apache.maven.extension.internal.CoreExtensionEntry; +import org.apache.maven.lifecycle.LifecycleExecutionException; +import org.apache.maven.model.building.ModelProcessor; +import org.apache.maven.project.MavenProject; +import org.apache.maven.properties.internal.EnvironmentUtils; +import org.apache.maven.properties.internal.SystemProperties; +import org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest; +import org.apache.maven.toolchain.building.ToolchainsBuilder; +import org.apache.maven.toolchain.building.ToolchainsBuildingResult; +import org.codehaus.plexus.ContainerConfiguration; +import org.codehaus.plexus.DefaultContainerConfiguration; +import org.codehaus.plexus.DefaultPlexusContainer; +import org.codehaus.plexus.PlexusConstants; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.classworlds.ClassWorld; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.classworlds.realm.NoSuchRealmException; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.codehaus.plexus.logging.LoggerManager; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import org.eclipse.aether.transfer.TransferListener; +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.sonatype.plexus.components.cipher.DefaultPlexusCipher; +import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher; +import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; +import org.sonatype.plexus.components.sec.dispatcher.SecUtil; +import org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity; + +import com.google.common.base.Charsets; +import com.google.common.io.Files; +import com.google.inject.AbstractModule; + +// TODO: push all common bits back to plexus cli and prepare for transition to Guice. We don't need 50 ways to make CLIs + +/** + * @author Jason van Zyl + * @noinspection UseOfSystemOutOrSystemErr,ACCESS_STATIC_VIA_INSTANCE + */ +public class MavenCli +{ + public static final String LOCAL_REPO_PROPERTY = "maven.repo.local"; + + public static final String THREADS_DEPRECATED = "maven.threads.experimental"; + + public static final String MULTIMODULE_PROJECT_DIRECTORY = "maven.multiModuleProjectDirectory"; + + @SuppressWarnings( "checkstyle:constantname" ) + public static final String userHome = System.getProperty( "user.home" ); + + @SuppressWarnings( "checkstyle:constantname" ) + public static final File userMavenConfigurationHome = new File( userHome, ".m2" ); + + /** + * @deprecated use {@link SettingsXmlConfigurationProcessor#DEFAULT_USER_SETTINGS_FILE} + */ + public static final File DEFAULT_USER_SETTINGS_FILE = SettingsXmlConfigurationProcessor.DEFAULT_USER_SETTINGS_FILE; + + /** + * @deprecated use {@link SettingsXmlConfigurationProcessor#DEFAULT_GLOBAL_SETTINGS_FILE} + */ + public static final File DEFAULT_GLOBAL_SETTINGS_FILE = + SettingsXmlConfigurationProcessor.DEFAULT_GLOBAL_SETTINGS_FILE; + + public static final File DEFAULT_USER_TOOLCHAINS_FILE = new File( userMavenConfigurationHome, "toolchains.xml" ); + + public static final File DEFAULT_GLOBAL_TOOLCHAINS_FILE = + new File( System.getProperty( "maven.home", System.getProperty( "user.dir", "" ) ), "conf/toolchains.xml" ); + + private static final String EXT_CLASS_PATH = "maven.ext.class.path"; + + private static final String EXTENSIONS_FILENAME = ".mvn/extensions.xml"; + + private ClassWorld classWorld; + + private LoggerManager plexusLoggerManager; + + private ILoggerFactory slf4jLoggerFactory; + + private Logger slf4jLogger; + + private EventSpyDispatcher eventSpyDispatcher; + + private ModelProcessor modelProcessor; + + private Maven maven; + + private MavenExecutionRequestPopulator executionRequestPopulator; + + private ToolchainsBuilder toolchainsBuilder; + + private DefaultSecDispatcher dispatcher; + + private Map configurationProcessors; + + public MavenCli() + { + this( null ); + } + + // This supports painless invocation by the Verifier during embedded execution of the core ITs + public MavenCli( ClassWorld classWorld ) + { + this.classWorld = classWorld; + } + + public static void main( String[] args ) + { + int result = main( args, null ); + + System.exit( result ); + } + + /** @noinspection ConfusingMainMethod */ + public static int main( String[] args, ClassWorld classWorld ) + { + MavenCli cli = new MavenCli(); + return cli.doMain( new CliRequest( args, classWorld ) ); + } + + // TODO: need to externalize CliRequest + public static int doMain( String[] args, ClassWorld classWorld ) + { + MavenCli cli = new MavenCli(); + return cli.doMain( new CliRequest( args, classWorld ) ); + } + + // This supports painless invocation by the Verifier during embedded execution of the core ITs + public int doMain( String[] args, String workingDirectory, PrintStream stdout, PrintStream stderr ) + { + PrintStream oldout = System.out; + PrintStream olderr = System.err; + + final Set realms; + if ( classWorld != null ) + { + realms = new HashSet(); + for ( ClassRealm realm : classWorld.getRealms() ) + { + realms.add( realm.getId() ); + } + } + else + { + realms = Collections.emptySet(); + } + + try + { + if ( stdout != null ) + { + System.setOut( stdout ); + } + if ( stderr != null ) + { + System.setErr( stderr ); + } + + CliRequest cliRequest = new CliRequest( args, classWorld ); + cliRequest.workingDirectory = workingDirectory; + + return doMain( cliRequest ); + } + finally + { + if ( classWorld != null ) + { + for ( ClassRealm realm : new ArrayList( classWorld.getRealms() ) ) + { + String realmId = realm.getId(); + if ( !realms.contains( realmId ) ) + { + try + { + classWorld.disposeRealm( realmId ); + } + catch ( NoSuchRealmException ignored ) + { + // can't happen + } + } + } + } + System.setOut( oldout ); + System.setErr( olderr ); + } + } + + // TODO: need to externalize CliRequest + public int doMain( CliRequest cliRequest ) + { + PlexusContainer localContainer = null; + try + { + initialize( cliRequest ); + cli( cliRequest ); + logging( cliRequest ); + version( cliRequest ); + properties( cliRequest ); + localContainer = container( cliRequest ); + commands( cliRequest ); + configure( cliRequest ); + toolchains( cliRequest ); + populateRequest( cliRequest ); + encryption( cliRequest ); + repository( cliRequest ); + return execute( cliRequest ); + } + catch ( ExitException e ) + { + return e.exitCode; + } + catch ( UnrecognizedOptionException e ) + { + // pure user error, suppress stack trace + return 1; + } + catch ( BuildAbort e ) + { + CLIReportingUtils.showError( slf4jLogger, "ABORTED", e, cliRequest.showErrors ); + + return 2; + } + catch ( Exception e ) + { + CLIReportingUtils.showError( slf4jLogger, "Error executing Maven.", e, cliRequest.showErrors ); + + return 1; + } + finally + { + if ( localContainer != null ) + { + localContainer.dispose(); + } + } + } + + void initialize( CliRequest cliRequest ) + throws ExitException + { + if ( cliRequest.workingDirectory == null ) + { + cliRequest.workingDirectory = System.getProperty( "user.dir" ); + } + + if ( cliRequest.multiModuleProjectDirectory == null ) + { + String basedirProperty = System.getProperty( MULTIMODULE_PROJECT_DIRECTORY ); + if ( basedirProperty == null ) + { + System.err.format( "-D%s system propery is not set." + + " Check $M2_HOME environment variable and mvn script match.", MULTIMODULE_PROJECT_DIRECTORY ); + throw new ExitException( 1 ); + } + File basedir = basedirProperty != null ? new File( basedirProperty ) : new File( "" ); + try + { + cliRequest.multiModuleProjectDirectory = basedir.getCanonicalFile(); + } + catch ( IOException e ) + { + cliRequest.multiModuleProjectDirectory = basedir.getAbsoluteFile(); + } + } + + // + // Make sure the Maven home directory is an absolute path to save us from confusion with say drive-relative + // Windows paths. + // + String mavenHome = System.getProperty( "maven.home" ); + + if ( mavenHome != null ) + { + System.setProperty( "maven.home", new File( mavenHome ).getAbsolutePath() ); + } + } + + void cli( CliRequest cliRequest ) + throws Exception + { + // + // Parsing errors can happen during the processing of the arguments and we prefer not having to check if + // the logger is null and construct this so we can use an SLF4J logger everywhere. + // + slf4jLogger = new Slf4jStdoutLogger(); + + CLIManager cliManager = new CLIManager(); + + List args = new ArrayList(); + + try + { + File configFile = new File( cliRequest.multiModuleProjectDirectory, ".mvn/maven.config" ); + + if ( configFile.isFile() ) + { + for ( String arg : Files.toString( configFile, Charsets.UTF_8 ).split( "\\s+" ) ) + { + args.add( arg ); + } + + CommandLine config = cliManager.parse( args.toArray( new String[args.size()] ) ); + List unrecongized = config.getArgList(); + if ( !unrecongized.isEmpty() ) + { + throw new ParseException( "Unrecognized maven.config entries: " + unrecongized ); + } + } + } + catch ( ParseException e ) + { + System.err.println( "Unable to parse maven.config: " + e.getMessage() ); + cliManager.displayHelp( System.out ); + throw e; + } + + try + { + args.addAll( 0, Arrays.asList( cliRequest.args ) ); + cliRequest.commandLine = cliManager.parse( args.toArray( new String[args.size()] ) ); + } + catch ( ParseException e ) + { + System.err.println( "Unable to parse command line options: " + e.getMessage() ); + cliManager.displayHelp( System.out ); + throw e; + } + + if ( cliRequest.commandLine.hasOption( CLIManager.HELP ) ) + { + cliManager.displayHelp( System.out ); + throw new ExitException( 0 ); + } + + if ( cliRequest.commandLine.hasOption( CLIManager.VERSION ) ) + { + System.out.println( CLIReportingUtils.showVersion() ); + throw new ExitException( 0 ); + } + } + + /** + * configure logging + */ + private void logging( CliRequest cliRequest ) + { + cliRequest.debug = cliRequest.commandLine.hasOption( CLIManager.DEBUG ); + cliRequest.quiet = !cliRequest.debug && cliRequest.commandLine.hasOption( CLIManager.QUIET ); + cliRequest.showErrors = cliRequest.debug || cliRequest.commandLine.hasOption( CLIManager.ERRORS ); + + slf4jLoggerFactory = LoggerFactory.getILoggerFactory(); + Slf4jConfiguration slf4jConfiguration = Slf4jConfigurationFactory.getConfiguration( slf4jLoggerFactory ); + + if ( cliRequest.debug ) + { + cliRequest.request.setLoggingLevel( MavenExecutionRequest.LOGGING_LEVEL_DEBUG ); + slf4jConfiguration.setRootLoggerLevel( Slf4jConfiguration.Level.DEBUG ); + } + else if ( cliRequest.quiet ) + { + cliRequest.request.setLoggingLevel( MavenExecutionRequest.LOGGING_LEVEL_ERROR ); + slf4jConfiguration.setRootLoggerLevel( Slf4jConfiguration.Level.ERROR ); + } + // else fall back to default log level specified in conf + // see http://jira.codehaus.org/browse/MNG-2570 + + if ( cliRequest.commandLine.hasOption( CLIManager.LOG_FILE ) ) + { + File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) ); + logFile = resolveFile( logFile, cliRequest.workingDirectory ); + + // redirect stdout and stderr to file + try + { + PrintStream ps = new PrintStream( new FileOutputStream( logFile ) ); + System.setOut( ps ); + System.setErr( ps ); + } + catch ( FileNotFoundException e ) + { + // + // Ignore + // + } + } + + slf4jConfiguration.activate(); + + plexusLoggerManager = new Slf4jLoggerManager(); + slf4jLogger = slf4jLoggerFactory.getLogger( this.getClass().getName() ); + } + + private void version( CliRequest cliRequest ) + { + if ( cliRequest.debug || cliRequest.commandLine.hasOption( CLIManager.SHOW_VERSION ) ) + { + System.out.println( CLIReportingUtils.showVersion() ); + } + } + + private void commands( CliRequest cliRequest ) + { + if ( cliRequest.showErrors ) + { + slf4jLogger.info( "Error stacktraces are turned on." ); + } + + if ( MavenExecutionRequest.CHECKSUM_POLICY_WARN.equals( cliRequest.request.getGlobalChecksumPolicy() ) ) + { + slf4jLogger.info( "Disabling strict checksum verification on all artifact downloads." ); + } + else if ( MavenExecutionRequest.CHECKSUM_POLICY_FAIL.equals( cliRequest.request.getGlobalChecksumPolicy() ) ) + { + slf4jLogger.info( "Enabling strict checksum verification on all artifact downloads." ); + } + } + + private void properties( CliRequest cliRequest ) + { + populateProperties( cliRequest.commandLine, cliRequest.systemProperties, cliRequest.userProperties ); + } + + private PlexusContainer container( CliRequest cliRequest ) + throws Exception + { + if ( cliRequest.classWorld == null ) + { + cliRequest.classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() ); + } + + ClassRealm coreRealm = cliRequest.classWorld.getClassRealm( "plexus.core" ); + if ( coreRealm == null ) + { + coreRealm = cliRequest.classWorld.getRealms().iterator().next(); + } + + List extClassPath = parseExtClasspath( cliRequest ); + + CoreExtensionEntry coreEntry = CoreExtensionEntry.discoverFrom( coreRealm ); + List extensions = + loadCoreExtensions( cliRequest, coreRealm, coreEntry.getExportedArtifacts() ); + + ClassRealm containerRealm = setupContainerRealm( cliRequest.classWorld, coreRealm, extClassPath, extensions ); + + ContainerConfiguration cc = new DefaultContainerConfiguration() + .setClassWorld( cliRequest.classWorld ) + .setRealm( containerRealm ) + .setClassPathScanning( PlexusConstants.SCANNING_INDEX ) + .setAutoWiring( true ) + .setName( "maven" ); + + Set exportedArtifacts = new HashSet( coreEntry.getExportedArtifacts() ); + Set exportedPackages = new HashSet( coreEntry.getExportedPackages() ); + for ( CoreExtensionEntry extension : extensions ) + { + exportedArtifacts.addAll( extension.getExportedArtifacts() ); + exportedPackages.addAll( extension.getExportedPackages() ); + } + + final CoreExports exports = new CoreExports( containerRealm, exportedArtifacts, exportedPackages ); + + DefaultPlexusContainer container = new DefaultPlexusContainer( cc, new AbstractModule() + { + @Override + protected void configure() + { + bind( ILoggerFactory.class ).toInstance( slf4jLoggerFactory ); + bind( CoreExports.class ).toInstance( exports ); + } + } ); + + // NOTE: To avoid inconsistencies, we'll use the TCCL exclusively for lookups + container.setLookupRealm( null ); + + container.setLoggerManager( plexusLoggerManager ); + + for ( CoreExtensionEntry extension : extensions ) + { + container.discoverComponents( extension.getClassRealm() ); + } + + customizeContainer( container ); + + container.getLoggerManager().setThresholds( cliRequest.request.getLoggingLevel() ); + + Thread.currentThread().setContextClassLoader( container.getContainerRealm() ); + + eventSpyDispatcher = container.lookup( EventSpyDispatcher.class ); + + DefaultEventSpyContext eventSpyContext = new DefaultEventSpyContext(); + Map data = eventSpyContext.getData(); + data.put( "plexus", container ); + data.put( "workingDirectory", cliRequest.workingDirectory ); + data.put( "systemProperties", cliRequest.systemProperties ); + data.put( "userProperties", cliRequest.userProperties ); + data.put( "versionProperties", CLIReportingUtils.getBuildProperties() ); + eventSpyDispatcher.init( eventSpyContext ); + + // refresh logger in case container got customized by spy + slf4jLogger = slf4jLoggerFactory.getLogger( this.getClass().getName() ); + + maven = container.lookup( Maven.class ); + + executionRequestPopulator = container.lookup( MavenExecutionRequestPopulator.class ); + + modelProcessor = createModelProcessor( container ); + + configurationProcessors = container.lookupMap( ConfigurationProcessor.class ); + + toolchainsBuilder = container.lookup( ToolchainsBuilder.class ); + + dispatcher = (DefaultSecDispatcher) container.lookup( SecDispatcher.class, "maven" ); + + return container; + } + + private List loadCoreExtensions( CliRequest cliRequest, ClassRealm containerRealm, + Set providedArtifacts ) + { + if ( cliRequest.multiModuleProjectDirectory == null ) + { + return Collections.emptyList(); + } + + File extensionsFile = new File( cliRequest.multiModuleProjectDirectory, EXTENSIONS_FILENAME ); + if ( !extensionsFile.isFile() ) + { + return Collections.emptyList(); + } + + try + { + List extensions = readCoreExtensionsDescriptor( extensionsFile ); + if ( extensions.isEmpty() ) + { + return Collections.emptyList(); + } + + ContainerConfiguration cc = new DefaultContainerConfiguration() // + .setClassWorld( cliRequest.classWorld ) // + .setRealm( containerRealm ) // + .setClassPathScanning( PlexusConstants.SCANNING_INDEX ) // + .setAutoWiring( true ) // + .setName( "maven" ); + + DefaultPlexusContainer container = new DefaultPlexusContainer( cc, new AbstractModule() + { + @Override + protected void configure() + { + bind( ILoggerFactory.class ).toInstance( slf4jLoggerFactory ); + } + } ); + + try + { + container.setLookupRealm( null ); + + container.setLoggerManager( plexusLoggerManager ); + + container.getLoggerManager().setThresholds( cliRequest.request.getLoggingLevel() ); + + Thread.currentThread().setContextClassLoader( container.getContainerRealm() ); + + executionRequestPopulator = container.lookup( MavenExecutionRequestPopulator.class ); + + configurationProcessors = container.lookupMap( ConfigurationProcessor.class ); + + configure( cliRequest ); + + MavenExecutionRequest request = DefaultMavenExecutionRequest.copy( cliRequest.request ); + + request = populateRequest( cliRequest, request ); + + request = executionRequestPopulator.populateDefaults( request ); + + BootstrapCoreExtensionManager resolver = container.lookup( BootstrapCoreExtensionManager.class ); + + return resolver.loadCoreExtensions( request, providedArtifacts, extensions ); + } + finally + { + executionRequestPopulator = null; + container.dispose(); + } + } + catch ( RuntimeException e ) + { + // runtime exceptions are most likely bugs in maven, let them bubble up to the user + throw e; + } + catch ( Exception e ) + { + slf4jLogger.warn( "Failed to read extensions descriptor " + extensionsFile + ": " + e.getMessage() ); + } + return Collections.emptyList(); + } + + private List readCoreExtensionsDescriptor( File extensionsFile ) + throws IOException, XmlPullParserException + { + CoreExtensionsXpp3Reader parser = new CoreExtensionsXpp3Reader(); + InputStream is = null; + try + { + is = new BufferedInputStream( new FileInputStream( extensionsFile ) ); + return parser.read( is ).getExtensions(); + } + finally + { + IOUtil.close( is ); + } + } + + private ClassRealm setupContainerRealm( ClassWorld classWorld, ClassRealm coreRealm, List extClassPath, + List extensions ) + throws Exception + { + if ( !extClassPath.isEmpty() || !extensions.isEmpty() ) + { + ClassRealm extRealm = classWorld.newRealm( "maven.ext", null ); + + extRealm.setParentRealm( coreRealm ); + + slf4jLogger.debug( "Populating class realm " + extRealm.getId() ); + + for ( File file : extClassPath ) + { + slf4jLogger.debug( " Included " + file ); + + extRealm.addURL( file.toURI().toURL() ); + } + + for ( CoreExtensionEntry entry : reverse( extensions ) ) + { + Set exportedPackages = entry.getExportedPackages(); + ClassRealm realm = entry.getClassRealm(); + for ( String exportedPackage : exportedPackages ) + { + extRealm.importFrom( realm, exportedPackage ); + } + if ( exportedPackages.isEmpty() ) + { + // sisu uses realm imports to establish component visibility + extRealm.importFrom( realm, realm.getId() ); + } + } + + return extRealm; + } + + return coreRealm; + } + + private static List reverse( List list ) + { + List copy = new ArrayList( list ); + Collections.reverse( copy ); + return copy; + } + + private List parseExtClasspath( CliRequest cliRequest ) + { + String extClassPath = cliRequest.userProperties.getProperty( EXT_CLASS_PATH ); + if ( extClassPath == null ) + { + extClassPath = cliRequest.systemProperties.getProperty( EXT_CLASS_PATH ); + } + + List jars = new ArrayList(); + + if ( StringUtils.isNotEmpty( extClassPath ) ) + { + for ( String jar : StringUtils.split( extClassPath, File.pathSeparator ) ) + { + File file = resolveFile( new File( jar ), cliRequest.workingDirectory ); + + slf4jLogger.debug( " Included " + file ); + + jars.add( file ); + } + } + + return jars; + } + + // + // This should probably be a separate tool and not be baked into Maven. + // + private void encryption( CliRequest cliRequest ) + throws Exception + { + if ( cliRequest.commandLine.hasOption( CLIManager.ENCRYPT_MASTER_PASSWORD ) ) + { + String passwd = cliRequest.commandLine.getOptionValue( CLIManager.ENCRYPT_MASTER_PASSWORD ); + + if ( passwd == null ) + { + Console cons = System.console(); + char[] password = ( cons == null ) ? null : cons.readPassword( "Master password: " ); + if ( password != null ) + { + // Cipher uses Strings + passwd = String.copyValueOf( password ); + + // Sun/Oracle advises to empty the char array + java.util.Arrays.fill( password, ' ' ); + } + } + + DefaultPlexusCipher cipher = new DefaultPlexusCipher(); + + System.out.println( cipher.encryptAndDecorate( passwd, + DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ) ); + + throw new ExitException( 0 ); + } + else if ( cliRequest.commandLine.hasOption( CLIManager.ENCRYPT_PASSWORD ) ) + { + String passwd = cliRequest.commandLine.getOptionValue( CLIManager.ENCRYPT_PASSWORD ); + + if ( passwd == null ) + { + Console cons = System.console(); + char[] password = ( cons == null ) ? null : cons.readPassword( "Password: " ); + if ( password != null ) + { + // Cipher uses Strings + passwd = String.copyValueOf( password ); + + // Sun/Oracle advises to empty the char array + java.util.Arrays.fill( password, ' ' ); + } + } + + String configurationFile = dispatcher.getConfigurationFile(); + + if ( configurationFile.startsWith( "~" ) ) + { + configurationFile = System.getProperty( "user.home" ) + configurationFile.substring( 1 ); + } + + String file = System.getProperty( DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION, configurationFile ); + + String master = null; + + SettingsSecurity sec = SecUtil.read( file, true ); + if ( sec != null ) + { + master = sec.getMaster(); + } + + if ( master == null ) + { + throw new IllegalStateException( "Master password is not set in the setting security file: " + file ); + } + + DefaultPlexusCipher cipher = new DefaultPlexusCipher(); + String masterPasswd = cipher.decryptDecorated( master, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ); + System.out.println( cipher.encryptAndDecorate( passwd, masterPasswd ) ); + + throw new ExitException( 0 ); + } + } + + private void repository( CliRequest cliRequest ) + throws Exception + { + if ( cliRequest.commandLine.hasOption( CLIManager.LEGACY_LOCAL_REPOSITORY ) + || Boolean.getBoolean( "maven.legacyLocalRepo" ) ) + { + cliRequest.request.setUseLegacyLocalRepository( true ); + } + } + + private int execute( CliRequest cliRequest ) throws MavenExecutionRequestPopulationException + { + MavenExecutionRequest request = executionRequestPopulator.populateDefaults( cliRequest.request ); + + eventSpyDispatcher.onEvent( request ); + + MavenExecutionResult result = maven.execute( request ); + + eventSpyDispatcher.onEvent( result ); + + eventSpyDispatcher.close(); + + if ( result.hasExceptions() ) + { + ExceptionHandler handler = new DefaultExceptionHandler(); + + Map references = new LinkedHashMap(); + + MavenProject project = null; + + for ( Throwable exception : result.getExceptions() ) + { + ExceptionSummary summary = handler.handleException( exception ); + + logSummary( summary, references, "", cliRequest.showErrors ); + + if ( project == null && exception instanceof LifecycleExecutionException ) + { + project = ( (LifecycleExecutionException) exception ).getProject(); + } + } + + slf4jLogger.error( "" ); + + if ( !cliRequest.showErrors ) + { + slf4jLogger.error( "To see the full stack trace of the errors, re-run Maven with the -e switch." ); + } + if ( !slf4jLogger.isDebugEnabled() ) + { + slf4jLogger.error( "Re-run Maven using the -X switch to enable full debug logging." ); + } + + if ( !references.isEmpty() ) + { + slf4jLogger.error( "" ); + slf4jLogger.error( "For more information about the errors and possible solutions" + + ", please read the following articles:" ); + + for ( Map.Entry entry : references.entrySet() ) + { + slf4jLogger.error( entry.getValue() + " " + entry.getKey() ); + } + } + + if ( project != null && !project.equals( result.getTopologicallySortedProjects().get( 0 ) ) ) + { + slf4jLogger.error( "" ); + slf4jLogger.error( "After correcting the problems, you can resume the build with the command" ); + slf4jLogger.error( " mvn -rf :" + project.getArtifactId() ); + } + + if ( MavenExecutionRequest.REACTOR_FAIL_NEVER.equals( cliRequest.request.getReactorFailureBehavior() ) ) + { + slf4jLogger.info( "Build failures were ignored." ); + + return 0; + } + else + { + return 1; + } + } + else + { + return 0; + } + } + + private void logSummary( ExceptionSummary summary, Map references, String indent, + boolean showErrors ) + { + String referenceKey = ""; + + if ( StringUtils.isNotEmpty( summary.getReference() ) ) + { + referenceKey = references.get( summary.getReference() ); + if ( referenceKey == null ) + { + referenceKey = "[Help " + ( references.size() + 1 ) + "]"; + references.put( summary.getReference(), referenceKey ); + } + } + + String msg = summary.getMessage(); + + if ( StringUtils.isNotEmpty( referenceKey ) ) + { + if ( msg.indexOf( '\n' ) < 0 ) + { + msg += " -> " + referenceKey; + } + else + { + msg += "\n-> " + referenceKey; + } + } + + String[] lines = msg.split( "(\r\n)|(\r)|(\n)" ); + + for ( int i = 0; i < lines.length; i++ ) + { + String line = indent + lines[i].trim(); + + if ( ( i == lines.length - 1 ) + && ( showErrors || ( summary.getException() instanceof InternalErrorException ) ) ) + { + slf4jLogger.error( line, summary.getException() ); + } + else + { + slf4jLogger.error( line ); + } + } + + indent += " "; + + for ( ExceptionSummary child : summary.getChildren() ) + { + logSummary( child, references, indent, showErrors ); + } + } + + @SuppressWarnings( "checkstyle:methodlength" ) + private void configure( CliRequest cliRequest ) + throws Exception + { + // + // This is not ideal but there are events specifically for configuration from the CLI which I don't + // believe are really valid but there are ITs which assert the right events are published so this + // needs to be supported so the EventSpyDispatcher needs to be put in the CliRequest so that + // it can be accessed by configuration processors. + // + cliRequest.request.setEventSpyDispatcher( eventSpyDispatcher ); + + // + // We expect at most 2 implementations to be available. The SettingsXmlConfigurationProcessor implementation + // is always available in the core and likely always will be, but we may have another ConfigurationProcessor + // present supplied by the user. The rule is that we only allow the execution of one ConfigurationProcessor. + // If there is more than one then we execute the one supplied by the user, otherwise we execute the + // the default SettingsXmlConfigurationProcessor. + // + int userSuppliedConfigurationProcessorCount = configurationProcessors.size() - 1; + + if ( userSuppliedConfigurationProcessorCount == 0 ) + { + // + // Our settings.xml source is historically how we have configured Maven from the CLI so we are going to + // have to honour its existence forever. So let's run it. + // + configurationProcessors.get( SettingsXmlConfigurationProcessor.HINT ).process( cliRequest ); + } + else if ( userSuppliedConfigurationProcessorCount == 1 ) + { + // + // Run the user supplied ConfigurationProcessor + // + for ( Entry entry : configurationProcessors.entrySet() ) + { + String hint = entry.getKey(); + if ( !hint.equals( SettingsXmlConfigurationProcessor.HINT ) ) + { + ConfigurationProcessor configurationProcessor = entry.getValue(); + configurationProcessor.process( cliRequest ); + } + } + } + else if ( userSuppliedConfigurationProcessorCount > 1 ) + { + // + // There are too many ConfigurationProcessors so we don't know which one to run so report the error. + // + StringBuffer sb = new StringBuffer( + String.format( "\nThere can only be one user supplied ConfigurationProcessor, there are %s:\n\n", + userSuppliedConfigurationProcessorCount ) ); + for ( Entry entry : configurationProcessors.entrySet() ) + { + String hint = entry.getKey(); + if ( !hint.equals( SettingsXmlConfigurationProcessor.HINT ) ) + { + ConfigurationProcessor configurationProcessor = entry.getValue(); + sb.append( String.format( "%s\n", configurationProcessor.getClass().getName() ) ); + } + } + sb.append( String.format( "\n" ) ); + throw new Exception( sb.toString() ); + } + } + + @SuppressWarnings( "checkstyle:methodlength" ) + private void toolchains( CliRequest cliRequest ) + throws Exception + { + File userToolchainsFile; + + if ( cliRequest.commandLine.hasOption( CLIManager.ALTERNATE_USER_TOOLCHAINS ) ) + { + userToolchainsFile = + new File( cliRequest.commandLine.getOptionValue( CLIManager.ALTERNATE_USER_TOOLCHAINS ) ); + userToolchainsFile = resolveFile( userToolchainsFile, cliRequest.workingDirectory ); + + if ( !userToolchainsFile.isFile() ) + { + throw new FileNotFoundException( "The specified user toolchains file does not exist: " + + userToolchainsFile ); + } + } + else + { + userToolchainsFile = DEFAULT_USER_TOOLCHAINS_FILE; + } + + File globalToolchainsFile; + + if ( cliRequest.commandLine.hasOption( CLIManager.ALTERNATE_GLOBAL_TOOLCHAINS ) ) + { + globalToolchainsFile = + new File( cliRequest.commandLine.getOptionValue( CLIManager.ALTERNATE_GLOBAL_TOOLCHAINS ) ); + globalToolchainsFile = resolveFile( globalToolchainsFile, cliRequest.workingDirectory ); + + if ( !globalToolchainsFile.isFile() ) + { + throw new FileNotFoundException( "The specified global toolchains file does not exist: " + + globalToolchainsFile ); + } + } + else + { + globalToolchainsFile = DEFAULT_GLOBAL_TOOLCHAINS_FILE; + } + + cliRequest.request.setGlobalToolchainsFile( globalToolchainsFile ); + cliRequest.request.setUserToolchainsFile( userToolchainsFile ); + + DefaultToolchainsBuildingRequest toolchainsRequest = new DefaultToolchainsBuildingRequest(); + if ( globalToolchainsFile.isFile() ) + { + toolchainsRequest.setGlobalToolchainsSource( new FileSource( globalToolchainsFile ) ); + } + if ( userToolchainsFile.isFile() ) + { + toolchainsRequest.setUserToolchainsSource( new FileSource( userToolchainsFile ) ); + } + + eventSpyDispatcher.onEvent( toolchainsRequest ); + + slf4jLogger.debug( "Reading global toolchains from " + + getLocation( toolchainsRequest.getGlobalToolchainsSource(), globalToolchainsFile ) ); + slf4jLogger.debug( "Reading user toolchains from " + + getLocation( toolchainsRequest.getUserToolchainsSource(), userToolchainsFile ) ); + + ToolchainsBuildingResult toolchainsResult = toolchainsBuilder.build( toolchainsRequest ); + + eventSpyDispatcher.onEvent( toolchainsRequest ); + + executionRequestPopulator.populateFromToolchains( cliRequest.request, + toolchainsResult.getEffectiveToolchains() ); + + if ( !toolchainsResult.getProblems().isEmpty() && slf4jLogger.isWarnEnabled() ) + { + slf4jLogger.warn( "" ); + slf4jLogger.warn( "Some problems were encountered while building the effective toolchains" ); + + for ( Problem problem : toolchainsResult.getProblems() ) + { + slf4jLogger.warn( problem.getMessage() + " @ " + problem.getLocation() ); + } + + slf4jLogger.warn( "" ); + } + } + + private Object getLocation( Source source, File defaultLocation ) + { + if ( source != null ) + { + return source.getLocation(); + } + return defaultLocation; + } + + private MavenExecutionRequest populateRequest( CliRequest cliRequest ) + { + return populateRequest( cliRequest, cliRequest.request ); + } + + private MavenExecutionRequest populateRequest( CliRequest cliRequest, MavenExecutionRequest request ) + { + CommandLine commandLine = cliRequest.commandLine; + String workingDirectory = cliRequest.workingDirectory; + boolean quiet = cliRequest.quiet; + boolean showErrors = cliRequest.showErrors; + + String[] deprecatedOptions = { "up", "npu", "cpu", "npr" }; + for ( String deprecatedOption : deprecatedOptions ) + { + if ( commandLine.hasOption( deprecatedOption ) ) + { + slf4jLogger.warn( "Command line option -" + deprecatedOption + + " is deprecated and will be removed in future Maven versions." ); + } + } + + // ---------------------------------------------------------------------- + // Now that we have everything that we need we will fire up plexus and + // bring the maven component to life for use. + // ---------------------------------------------------------------------- + + if ( commandLine.hasOption( CLIManager.BATCH_MODE ) ) + { + request.setInteractiveMode( false ); + } + + boolean noSnapshotUpdates = false; + if ( commandLine.hasOption( CLIManager.SUPRESS_SNAPSHOT_UPDATES ) ) + { + noSnapshotUpdates = true; + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + @SuppressWarnings( "unchecked" ) + List goals = commandLine.getArgList(); + + boolean recursive = true; + + // this is the default behavior. + String reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_FAST; + + if ( commandLine.hasOption( CLIManager.NON_RECURSIVE ) ) + { + recursive = false; + } + + if ( commandLine.hasOption( CLIManager.FAIL_FAST ) ) + { + reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_FAST; + } + else if ( commandLine.hasOption( CLIManager.FAIL_AT_END ) ) + { + reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_AT_END; + } + else if ( commandLine.hasOption( CLIManager.FAIL_NEVER ) ) + { + reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_NEVER; + } + + if ( commandLine.hasOption( CLIManager.OFFLINE ) ) + { + request.setOffline( true ); + } + + boolean updateSnapshots = false; + + if ( commandLine.hasOption( CLIManager.UPDATE_SNAPSHOTS ) ) + { + updateSnapshots = true; + } + + String globalChecksumPolicy = null; + + if ( commandLine.hasOption( CLIManager.CHECKSUM_FAILURE_POLICY ) ) + { + globalChecksumPolicy = MavenExecutionRequest.CHECKSUM_POLICY_FAIL; + } + else if ( commandLine.hasOption( CLIManager.CHECKSUM_WARNING_POLICY ) ) + { + globalChecksumPolicy = MavenExecutionRequest.CHECKSUM_POLICY_WARN; + } + + File baseDirectory = new File( workingDirectory, "" ).getAbsoluteFile(); + + // ---------------------------------------------------------------------- + // Profile Activation + // ---------------------------------------------------------------------- + + List activeProfiles = new ArrayList(); + + List inactiveProfiles = new ArrayList(); + + if ( commandLine.hasOption( CLIManager.ACTIVATE_PROFILES ) ) + { + String[] profileOptionValues = commandLine.getOptionValues( CLIManager.ACTIVATE_PROFILES ); + if ( profileOptionValues != null ) + { + for ( String profileOptionValue : profileOptionValues ) + { + StringTokenizer profileTokens = new StringTokenizer( profileOptionValue, "," ); + + while ( profileTokens.hasMoreTokens() ) + { + String profileAction = profileTokens.nextToken().trim(); + + if ( profileAction.startsWith( "-" ) || profileAction.startsWith( "!" ) ) + { + inactiveProfiles.add( profileAction.substring( 1 ) ); + } + else if ( profileAction.startsWith( "+" ) ) + { + activeProfiles.add( profileAction.substring( 1 ) ); + } + else + { + activeProfiles.add( profileAction ); + } + } + } + } + } + + TransferListener transferListener; + + if ( quiet ) + { + transferListener = new QuietMavenTransferListener(); + } + else if ( request.isInteractiveMode() && !cliRequest.commandLine.hasOption( CLIManager.LOG_FILE ) ) + { + // + // If we're logging to a file then we don't want the console transfer listener as it will spew + // download progress all over the place + // + transferListener = getConsoleTransferListener(); + } + else + { + transferListener = getBatchTransferListener(); + } + + ExecutionListener executionListener = new ExecutionEventLogger(); + if ( eventSpyDispatcher != null ) + { + executionListener = eventSpyDispatcher.chainListener( executionListener ); + } + + String alternatePomFile = null; + if ( commandLine.hasOption( CLIManager.ALTERNATE_POM_FILE ) ) + { + alternatePomFile = commandLine.getOptionValue( CLIManager.ALTERNATE_POM_FILE ); + } + + File userToolchainsFile; + if ( commandLine.hasOption( CLIManager.ALTERNATE_USER_TOOLCHAINS ) ) + { + userToolchainsFile = new File( commandLine.getOptionValue( CLIManager.ALTERNATE_USER_TOOLCHAINS ) ); + userToolchainsFile = resolveFile( userToolchainsFile, workingDirectory ); + } + else + { + userToolchainsFile = MavenCli.DEFAULT_USER_TOOLCHAINS_FILE; + } + + request.setBaseDirectory( baseDirectory ).setGoals( goals ) + .setSystemProperties( cliRequest.systemProperties ) + .setUserProperties( cliRequest.userProperties ) + .setReactorFailureBehavior( reactorFailureBehaviour ) // default: fail fast + .setRecursive( recursive ) // default: true + .setShowErrors( showErrors ) // default: false + .addActiveProfiles( activeProfiles ) // optional + .addInactiveProfiles( inactiveProfiles ) // optional + .setExecutionListener( executionListener ) + .setTransferListener( transferListener ) // default: batch mode which goes along with interactive + .setUpdateSnapshots( updateSnapshots ) // default: false + .setNoSnapshotUpdates( noSnapshotUpdates ) // default: false + .setGlobalChecksumPolicy( globalChecksumPolicy ) // default: warn + .setMultiModuleProjectDirectory( cliRequest.multiModuleProjectDirectory ); + + if ( alternatePomFile != null ) + { + File pom = resolveFile( new File( alternatePomFile ), workingDirectory ); + if ( pom.isDirectory() ) + { + pom = new File( pom, "pom.xml" ); + } + + request.setPom( pom ); + } + else if ( modelProcessor != null ) + { + File pom = modelProcessor.locatePom( baseDirectory ); + + if ( pom.isFile() ) + { + request.setPom( pom ); + } + } + + if ( ( request.getPom() != null ) && ( request.getPom().getParentFile() != null ) ) + { + request.setBaseDirectory( request.getPom().getParentFile() ); + } + + if ( commandLine.hasOption( CLIManager.RESUME_FROM ) ) + { + request.setResumeFrom( commandLine.getOptionValue( CLIManager.RESUME_FROM ) ); + } + + if ( commandLine.hasOption( CLIManager.PROJECT_LIST ) ) + { + String[] projectOptionValues = commandLine.getOptionValues( CLIManager.PROJECT_LIST ); + + List inclProjects = new ArrayList(); + List exclProjects = new ArrayList(); + + if ( projectOptionValues != null ) + { + for ( String projectOptionValue : projectOptionValues ) + { + StringTokenizer projectTokens = new StringTokenizer( projectOptionValue, "," ); + + while ( projectTokens.hasMoreTokens() ) + { + String projectAction = projectTokens.nextToken().trim(); + + if ( projectAction.startsWith( "-" ) || projectAction.startsWith( "!" ) ) + { + exclProjects.add( projectAction.substring( 1 ) ); + } + else if ( projectAction.startsWith( "+" ) ) + { + inclProjects.add( projectAction.substring( 1 ) ); + } + else + { + inclProjects.add( projectAction ); + } + } + } + } + + request.setSelectedProjects( inclProjects ); + request.setExcludedProjects( exclProjects ); + } + + if ( commandLine.hasOption( CLIManager.ALSO_MAKE ) + && !commandLine.hasOption( CLIManager.ALSO_MAKE_DEPENDENTS ) ) + { + request.setMakeBehavior( MavenExecutionRequest.REACTOR_MAKE_UPSTREAM ); + } + else if ( !commandLine.hasOption( CLIManager.ALSO_MAKE ) + && commandLine.hasOption( CLIManager.ALSO_MAKE_DEPENDENTS ) ) + { + request.setMakeBehavior( MavenExecutionRequest.REACTOR_MAKE_DOWNSTREAM ); + } + else if ( commandLine.hasOption( CLIManager.ALSO_MAKE ) + && commandLine.hasOption( CLIManager.ALSO_MAKE_DEPENDENTS ) ) + { + request.setMakeBehavior( MavenExecutionRequest.REACTOR_MAKE_BOTH ); + } + + String localRepoProperty = request.getUserProperties().getProperty( MavenCli.LOCAL_REPO_PROPERTY ); + + if ( localRepoProperty == null ) + { + localRepoProperty = request.getSystemProperties().getProperty( MavenCli.LOCAL_REPO_PROPERTY ); + } + + if ( localRepoProperty != null ) + { + request.setLocalRepositoryPath( localRepoProperty ); + } + + request.setCacheNotFound( true ); + request.setCacheTransferError( false ); + + // + // Builder, concurrency and parallelism + // + // We preserve the existing methods for builder selection which is to look for various inputs in the threading + // configuration. We don't have an easy way to allow a pluggable builder to provide its own configuration + // parameters but this is sufficient for now. Ultimately we want components like Builders to provide a way to + // extend the command line to accept its own configuration parameters. + // + final String threadConfiguration = commandLine.hasOption( CLIManager.THREADS ) + ? commandLine.getOptionValue( CLIManager.THREADS ) + : request.getSystemProperties().getProperty( + MavenCli.THREADS_DEPRECATED ); // TODO: Remove this setting. Note that the int-tests use it + + if ( threadConfiguration != null ) + { + // + // Default to the standard multithreaded builder + // + request.setBuilderId( "multithreaded" ); + + if ( threadConfiguration.contains( "C" ) ) + { + request.setDegreeOfConcurrency( calculateDegreeOfConcurrencyWithCoreMultiplier( threadConfiguration ) ); + } + else + { + request.setDegreeOfConcurrency( Integer.valueOf( threadConfiguration ) ); + } + } + + // + // Allow the builder to be overriden by the user if requested. The builders are now pluggable. + // + if ( commandLine.hasOption( CLIManager.BUILDER ) ) + { + request.setBuilderId( commandLine.getOptionValue( CLIManager.BUILDER ) ); + } + + return request; + } + + int calculateDegreeOfConcurrencyWithCoreMultiplier( String threadConfiguration ) + { + int procs = Runtime.getRuntime().availableProcessors(); + return (int) ( Float.valueOf( threadConfiguration.replace( "C", "" ) ) * procs ); + } + + static File resolveFile( File file, String workingDirectory ) + { + if ( file == null ) + { + return null; + } + else if ( file.isAbsolute() ) + { + return file; + } + else if ( file.getPath().startsWith( File.separator ) ) + { + // drive-relative Windows path + return file.getAbsoluteFile(); + } + else + { + return new File( workingDirectory, file.getPath() ).getAbsoluteFile(); + } + } + + // ---------------------------------------------------------------------- + // System properties handling + // ---------------------------------------------------------------------- + + static void populateProperties( CommandLine commandLine, Properties systemProperties, Properties userProperties ) + { + EnvironmentUtils.addEnvVars( systemProperties ); + + // ---------------------------------------------------------------------- + // Options that are set on the command line become system properties + // and therefore are set in the session properties. System properties + // are most dominant. + // ---------------------------------------------------------------------- + + if ( commandLine.hasOption( CLIManager.SET_SYSTEM_PROPERTY ) ) + { + String[] defStrs = commandLine.getOptionValues( CLIManager.SET_SYSTEM_PROPERTY ); + + if ( defStrs != null ) + { + for ( String defStr : defStrs ) + { + setCliProperty( defStr, userProperties ); + } + } + } + + SystemProperties.addSystemProperties( systemProperties ); + + // ---------------------------------------------------------------------- + // Properties containing info about the currently running version of Maven + // These override any corresponding properties set on the command line + // ---------------------------------------------------------------------- + + Properties buildProperties = CLIReportingUtils.getBuildProperties(); + + String mavenVersion = buildProperties.getProperty( CLIReportingUtils.BUILD_VERSION_PROPERTY ); + systemProperties.setProperty( "maven.version", mavenVersion ); + + String mavenBuildVersion = CLIReportingUtils.createMavenVersionString( buildProperties ); + systemProperties.setProperty( "maven.build.version", mavenBuildVersion ); + } + + private static void setCliProperty( String property, Properties properties ) + { + String name; + + String value; + + int i = property.indexOf( "=" ); + + if ( i <= 0 ) + { + name = property.trim(); + + value = "true"; + } + else + { + name = property.substring( 0, i ).trim(); + + value = property.substring( i + 1 ); + } + + properties.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 ); + } + + static class ExitException + extends Exception + { + @SuppressWarnings( "checkstyle:visibilitymodifier" ) + public int exitCode; + + public ExitException( int exitCode ) + { + this.exitCode = exitCode; + } + } + + // + // Customizations available via the CLI + // + + protected TransferListener getConsoleTransferListener() + { + return new ConsoleMavenTransferListener( System.out ); + } + + protected TransferListener getBatchTransferListener() + { + return new Slf4jMavenTransferListener(); + } + + protected void customizeContainer( PlexusContainer container ) + { + } + + protected ModelProcessor createModelProcessor( PlexusContainer container ) + throws ComponentLookupException + { + return container.lookup( ModelProcessor.class ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/configuration/ConfigurationProcessor.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/configuration/ConfigurationProcessor.java new file mode 100644 index 00000000..75fb9b91 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/configuration/ConfigurationProcessor.java @@ -0,0 +1,28 @@ +package org.apache.maven.cli.configuration; + +/* + * 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. + */ + +import org.apache.maven.cli.CliRequest; + +public interface ConfigurationProcessor +{ + void process( CliRequest request ) + throws Exception; +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java new file mode 100644 index 00000000..791a2267 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java @@ -0,0 +1,290 @@ +package org.apache.maven.cli.configuration; + +/* + * 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. + */ + +import java.io.File; +import java.io.FileNotFoundException; +import java.util.List; + +import org.apache.commons.cli.CommandLine; +import org.apache.maven.artifact.InvalidRepositoryException; +import org.apache.maven.bridge.MavenRepositorySystem; +import org.apache.maven.building.Source; +import org.apache.maven.cli.CLIManager; +import org.apache.maven.cli.CliRequest; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionRequestPopulationException; +import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.Repository; +import org.apache.maven.settings.Server; +import org.apache.maven.settings.Settings; +import org.apache.maven.settings.SettingsUtils; +import org.apache.maven.settings.building.DefaultSettingsBuildingRequest; +import org.apache.maven.settings.building.SettingsBuilder; +import org.apache.maven.settings.building.SettingsBuildingRequest; +import org.apache.maven.settings.building.SettingsBuildingResult; +import org.apache.maven.settings.building.SettingsProblem; +import org.apache.maven.settings.crypto.SettingsDecrypter; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.slf4j.Logger; + +@Component( role = ConfigurationProcessor.class, hint = SettingsXmlConfigurationProcessor.HINT ) +public class SettingsXmlConfigurationProcessor + implements ConfigurationProcessor +{ + public static final String HINT = "settings"; + + public static final String USER_HOME = System.getProperty( "user.home" ); + + public static final File USER_MAVEN_CONFIGURATION_HOME = new File( USER_HOME, ".m2" ); + + public static final File DEFAULT_USER_SETTINGS_FILE = new File( USER_MAVEN_CONFIGURATION_HOME, "settings.xml" ); + + public static final File DEFAULT_GLOBAL_SETTINGS_FILE = new File( System.getProperty( "maven.home", System + .getProperty( "user.dir", "" ) ), "conf/settings.xml" ); + + @Requirement + private Logger logger; + + @Requirement + private SettingsBuilder settingsBuilder; + + @Requirement + private SettingsDecrypter settingsDecrypter; + + @Override + public void process( CliRequest cliRequest ) + throws Exception + { + CommandLine commandLine = cliRequest.getCommandLine(); + String workingDirectory = cliRequest.getWorkingDirectory(); + MavenExecutionRequest request = cliRequest.getRequest(); + + File userSettingsFile; + + if ( commandLine.hasOption( CLIManager.ALTERNATE_USER_SETTINGS ) ) + { + userSettingsFile = new File( commandLine.getOptionValue( CLIManager.ALTERNATE_USER_SETTINGS ) ); + userSettingsFile = resolveFile( userSettingsFile, workingDirectory ); + + if ( !userSettingsFile.isFile() ) + { + throw new FileNotFoundException( "The specified user settings file does not exist: " + + userSettingsFile ); + } + } + else + { + userSettingsFile = DEFAULT_USER_SETTINGS_FILE; + } + + File globalSettingsFile; + + if ( commandLine.hasOption( CLIManager.ALTERNATE_GLOBAL_SETTINGS ) ) + { + globalSettingsFile = new File( commandLine.getOptionValue( CLIManager.ALTERNATE_GLOBAL_SETTINGS ) ); + globalSettingsFile = resolveFile( globalSettingsFile, workingDirectory ); + + if ( !globalSettingsFile.isFile() ) + { + throw new FileNotFoundException( "The specified global settings file does not exist: " + + globalSettingsFile ); + } + } + else + { + globalSettingsFile = DEFAULT_GLOBAL_SETTINGS_FILE; + } + + request.setGlobalSettingsFile( globalSettingsFile ); + request.setUserSettingsFile( userSettingsFile ); + + SettingsBuildingRequest settingsRequest = new DefaultSettingsBuildingRequest(); + settingsRequest.setGlobalSettingsFile( globalSettingsFile ); + settingsRequest.setUserSettingsFile( userSettingsFile ); + settingsRequest.setSystemProperties( cliRequest.getSystemProperties() ); + settingsRequest.setUserProperties( cliRequest.getUserProperties() ); + + if ( request.getEventSpyDispatcher() != null ) + { + request.getEventSpyDispatcher().onEvent( settingsRequest ); + } + + logger.debug( "Reading global settings from " + + getLocation( settingsRequest.getGlobalSettingsSource(), settingsRequest.getGlobalSettingsFile() ) ); + logger.debug( "Reading user settings from " + + getLocation( settingsRequest.getUserSettingsSource(), settingsRequest.getUserSettingsFile() ) ); + + SettingsBuildingResult settingsResult = settingsBuilder.build( settingsRequest ); + + if ( request.getEventSpyDispatcher() != null ) + { + request.getEventSpyDispatcher().onEvent( settingsResult ); + } + + populateFromSettings( request, settingsResult.getEffectiveSettings() ); + + if ( !settingsResult.getProblems().isEmpty() && logger.isWarnEnabled() ) + { + logger.warn( "" ); + logger.warn( "Some problems were encountered while building the effective settings" ); + + for ( SettingsProblem problem : settingsResult.getProblems() ) + { + logger.warn( problem.getMessage() + " @ " + problem.getLocation() ); + } + logger.warn( "" ); + } + } + + private MavenExecutionRequest populateFromSettings( MavenExecutionRequest request, Settings settings ) + throws MavenExecutionRequestPopulationException + { + if ( settings == null ) + { + return request; + } + + request.setOffline( settings.isOffline() ); + + request.setInteractiveMode( settings.isInteractiveMode() ); + + request.setPluginGroups( settings.getPluginGroups() ); + + request.setLocalRepositoryPath( settings.getLocalRepository() ); + + for ( Server server : settings.getServers() ) + { + server = server.clone(); + + request.addServer( server ); + } + + // + // + // true + // http + // proxy.somewhere.com + // 8080 + // proxyuser + // somepassword + // www.google.com|*.somewhere.com + // + // + + for ( Proxy proxy : settings.getProxies() ) + { + if ( !proxy.isActive() ) + { + continue; + } + + proxy = proxy.clone(); + + request.addProxy( proxy ); + } + + // + // + // nexus + // * + // http://repository.sonatype.org/content/groups/public + // + // + + for ( Mirror mirror : settings.getMirrors() ) + { + mirror = mirror.clone(); + + request.addMirror( mirror ); + } + + request.setActiveProfiles( settings.getActiveProfiles() ); + + for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() ) + { + request.addProfile( SettingsUtils.convertFromSettingsProfile( rawProfile ) ); + + if ( settings.getActiveProfiles().contains( rawProfile.getId() ) ) + { + List remoteRepositories = rawProfile.getRepositories(); + for ( Repository remoteRepository : remoteRepositories ) + { + try + { + request.addRemoteRepository( + MavenRepositorySystem.buildArtifactRepository( remoteRepository ) ); + } + catch ( InvalidRepositoryException e ) + { + // do nothing for now + } + } + + List pluginRepositories = rawProfile.getPluginRepositories(); + for ( Repository pluginRepository : pluginRepositories ) + { + try + { + request.addPluginArtifactRepository( + MavenRepositorySystem.buildArtifactRepository( pluginRepository ) ); + } + catch ( InvalidRepositoryException e ) + { + // do nothing for now + } + } + } + } + return request; + } + + private Object getLocation( Source source, File defaultLocation ) + { + if ( source != null ) + { + return source.getLocation(); + } + return defaultLocation; + } + + static File resolveFile( File file, String workingDirectory ) + { + if ( file == null ) + { + return null; + } + else if ( file.isAbsolute() ) + { + return file; + } + else if ( file.getPath().startsWith( File.separator ) ) + { + // drive-relative Windows path + return file.getAbsoluteFile(); + } + else + { + return new File( workingDirectory, file.getPath() ).getAbsoluteFile(); + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/event/DefaultEventSpyContext.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/event/DefaultEventSpyContext.java new file mode 100644 index 00000000..7c7976ab --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/event/DefaultEventSpyContext.java @@ -0,0 +1,38 @@ +package org.apache.maven.cli.event; + +/* + * 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. + */ + +import java.util.HashMap; +import java.util.Map; + +import org.apache.maven.eventspy.EventSpy; + +public class DefaultEventSpyContext + implements EventSpy.Context +{ + + private final Map data = new HashMap(); + + public Map getData() + { + return data; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java new file mode 100644 index 00000000..ad3ad3a4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java @@ -0,0 +1,381 @@ +package org.apache.maven.cli.event; + +/* + * 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. + */ + +import static org.apache.maven.cli.CLIReportingUtils.formatDuration; +import static org.apache.maven.cli.CLIReportingUtils.formatTimestamp; + +import org.apache.maven.execution.AbstractExecutionListener; +import org.apache.maven.execution.BuildFailure; +import org.apache.maven.execution.BuildSuccess; +import org.apache.maven.execution.BuildSummary; +import org.apache.maven.execution.ExecutionEvent; +import org.apache.maven.execution.MavenExecutionResult; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Logs execution events to logger, eventually user-supplied. + * + * @author Benjamin Bentmann + */ +public class ExecutionEventLogger + extends AbstractExecutionListener +{ + private final Logger logger; + + private static final int LINE_LENGTH = 72; + private static final int MAX_PADDED_BUILD_TIME_DURATION_LENGTH = 9; + private static final int MAX_PROJECT_NAME_LENGTH = 52; + + public ExecutionEventLogger() + { + logger = LoggerFactory.getLogger( ExecutionEventLogger.class ); + } + + // TODO should we deprecate? + public ExecutionEventLogger( Logger logger ) + { + if ( logger == null ) + { + throw new IllegalArgumentException( "logger missing" ); + } + + this.logger = logger; + } + + private static String chars( char c, int count ) + { + StringBuilder buffer = new StringBuilder( count ); + + for ( int i = count; i > 0; i-- ) + { + buffer.append( c ); + } + + return buffer.toString(); + } + + @Override + public void projectDiscoveryStarted( ExecutionEvent event ) + { + if ( logger.isInfoEnabled() ) + { + logger.info( "Scanning for projects..." ); + } + } + + @Override + public void sessionStarted( ExecutionEvent event ) + { + if ( logger.isInfoEnabled() && event.getSession().getProjects().size() > 1 ) + { + logger.info( chars( '-', LINE_LENGTH ) ); + + logger.info( "Reactor Build Order:" ); + + logger.info( "" ); + + for ( MavenProject project : event.getSession().getProjects() ) + { + logger.info( project.getName() ); + } + } + } + + @Override + public void sessionEnded( ExecutionEvent event ) + { + if ( logger.isInfoEnabled() ) + { + if ( event.getSession().getProjects().size() > 1 ) + { + logReactorSummary( event.getSession() ); + } + + logResult( event.getSession() ); + + logStats( event.getSession() ); + + logger.info( chars( '-', LINE_LENGTH ) ); + } + } + + private void logReactorSummary( MavenSession session ) + { + logger.info( chars( '-', LINE_LENGTH ) ); + + logger.info( "Reactor Summary:" ); + + logger.info( "" ); + + MavenExecutionResult result = session.getResult(); + + for ( MavenProject project : session.getProjects() ) + { + StringBuilder buffer = new StringBuilder( 128 ); + + buffer.append( project.getName() ); + buffer.append( ' ' ); + + if ( buffer.length() <= MAX_PROJECT_NAME_LENGTH ) + { + while ( buffer.length() < MAX_PROJECT_NAME_LENGTH ) + { + buffer.append( '.' ); + } + buffer.append( ' ' ); + } + + BuildSummary buildSummary = result.getBuildSummary( project ); + + if ( buildSummary == null ) + { + buffer.append( "SKIPPED" ); + } + else if ( buildSummary instanceof BuildSuccess ) + { + buffer.append( "SUCCESS [" ); + String buildTimeDuration = formatDuration( buildSummary.getTime() ); + int padSize = MAX_PADDED_BUILD_TIME_DURATION_LENGTH - buildTimeDuration.length(); + if ( padSize > 0 ) + { + buffer.append( chars( ' ', padSize ) ); + } + buffer.append( buildTimeDuration ); + buffer.append( "]" ); + } + else if ( buildSummary instanceof BuildFailure ) + { + buffer.append( "FAILURE [" ); + String buildTimeDuration = formatDuration( buildSummary.getTime() ); + int padSize = MAX_PADDED_BUILD_TIME_DURATION_LENGTH - buildTimeDuration.length(); + if ( padSize > 0 ) + { + buffer.append( chars( ' ', padSize ) ); + } + buffer.append( buildTimeDuration ); + buffer.append( "]" ); + } + + logger.info( buffer.toString() ); + } + } + + private void logResult( MavenSession session ) + { + logger.info( chars( '-', LINE_LENGTH ) ); + + if ( session.getResult().hasExceptions() ) + { + logger.info( "BUILD FAILURE" ); + } + else + { + logger.info( "BUILD SUCCESS" ); + } + } + + private void logStats( MavenSession session ) + { + logger.info( chars( '-', LINE_LENGTH ) ); + + long finish = System.currentTimeMillis(); + + long time = finish - session.getRequest().getStartTime().getTime(); + + String wallClock = session.getRequest().getDegreeOfConcurrency() > 1 ? " (Wall Clock)" : ""; + + logger.info( "Total time: " + formatDuration( time ) + wallClock ); + + logger.info( "Finished at: " + formatTimestamp( finish ) ); + + System.gc(); + + Runtime r = Runtime.getRuntime(); + + long mb = 1024 * 1024; + + logger.info( "Final Memory: " + ( r.totalMemory() - r.freeMemory() ) / mb + "M/" + r.totalMemory() / mb + "M" ); + } + + @Override + public void projectSkipped( ExecutionEvent event ) + { + if ( logger.isInfoEnabled() ) + { + logger.info( chars( ' ', LINE_LENGTH ) ); + logger.info( chars( '-', LINE_LENGTH ) ); + + logger.info( "Skipping " + event.getProject().getName() ); + logger.info( "This project has been banned from the build due to previous failures." ); + + logger.info( chars( '-', LINE_LENGTH ) ); + } + } + + @Override + public void projectStarted( ExecutionEvent event ) + { + if ( logger.isInfoEnabled() ) + { + logger.info( chars( ' ', LINE_LENGTH ) ); + logger.info( chars( '-', LINE_LENGTH ) ); + + logger.info( "Building " + event.getProject().getName() + " " + event.getProject().getVersion() ); + + logger.info( chars( '-', LINE_LENGTH ) ); + } + } + + @Override + public void mojoSkipped( ExecutionEvent event ) + { + if ( logger.isWarnEnabled() ) + { + logger.warn( "Goal " + event.getMojoExecution().getGoal() + + " requires online mode for execution but Maven is currently offline, skipping" ); + } + } + + /** + *
--- mojo-artifactId:version:goal (mojo-executionId) @ project-artifactId ---
+ */ + @Override + public void mojoStarted( ExecutionEvent event ) + { + if ( logger.isInfoEnabled() ) + { + StringBuilder buffer = new StringBuilder( 128 ); + + buffer.append( "--- " ); + append( buffer, event.getMojoExecution() ); + append( buffer, event.getProject() ); + buffer.append( " ---" ); + + logger.info( "" ); + logger.info( buffer.toString() ); + } + } + + /** + *
>>> mojo-artifactId:version:goal (mojo-executionId) > :forked-goal @ project-artifactId >>>
+ *
>>> mojo-artifactId:version:goal (mojo-executionId) > [lifecycle]phase @ project-artifactId >>>
+ */ + @Override + public void forkStarted( ExecutionEvent event ) + { + if ( logger.isInfoEnabled() ) + { + StringBuilder buffer = new StringBuilder( 128 ); + + buffer.append( ">>> " ); + append( buffer, event.getMojoExecution() ); + buffer.append( " > " ); + appendForkInfo( buffer, event.getMojoExecution().getMojoDescriptor() ); + append( buffer, event.getProject() ); + buffer.append( " >>>" ); + + logger.info( "" ); + logger.info( buffer.toString() ); + } + } + + // CHECKSTYLE_OFF: LineLength + /** + *
<<< mojo-artifactId:version:goal (mojo-executionId) < :forked-goal @ project-artifactId <<<
+ *
<<< mojo-artifactId:version:goal (mojo-executionId) < [lifecycle]phase @ project-artifactId <<<
+ */ + // CHECKSTYLE_ON: LineLength + @Override + public void forkSucceeded( ExecutionEvent event ) + { + if ( logger.isInfoEnabled() ) + { + StringBuilder buffer = new StringBuilder( 128 ); + + buffer.append( "<<< " ); + append( buffer, event.getMojoExecution() ); + buffer.append( " < " ); + appendForkInfo( buffer, event.getMojoExecution().getMojoDescriptor() ); + append( buffer, event.getProject() ); + buffer.append( " <<<" ); + + logger.info( "" ); + logger.info( buffer.toString() ); + } + } + + private void append( StringBuilder buffer, MojoExecution me ) + { + buffer.append( me.getArtifactId() ).append( ':' ).append( me.getVersion() ); + buffer.append( ':' ).append( me.getGoal() ); + if ( me.getExecutionId() != null ) + { + buffer.append( " (" ).append( me.getExecutionId() ).append( ')' ); + } + } + + private void appendForkInfo( StringBuilder buffer, MojoDescriptor md ) + { + if ( StringUtils.isNotEmpty( md.getExecutePhase() ) ) + { + // forked phase + if ( StringUtils.isNotEmpty( md.getExecuteLifecycle() ) ) + { + buffer.append( '[' ); + buffer.append( md.getExecuteLifecycle() ); + buffer.append( ']' ); + } + buffer.append( md.getExecutePhase() ); + } + else + { + // forked goal + buffer.append( ':' ); + buffer.append( md.getExecuteGoal() ); + } + } + + private void append( StringBuilder buffer, MavenProject project ) + { + buffer.append( " @ " ).append( project.getArtifactId() ); + } + + @Override + public void forkedProjectStarted( ExecutionEvent event ) + { + if ( logger.isInfoEnabled() && event.getMojoExecution().getForkedExecutions().size() > 1 ) + { + logger.info( chars( ' ', LINE_LENGTH ) ); + logger.info( chars( '>', LINE_LENGTH ) ); + + logger.info( "Forking " + event.getProject().getName() + " " + event.getProject().getVersion() ); + + logger.info( chars( '>', LINE_LENGTH ) ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java new file mode 100644 index 00000000..a431bded --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java @@ -0,0 +1,143 @@ +package org.apache.maven.cli.internal; + +/* + * 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. + */ + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.cli.internal.extension.model.CoreExtension; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.extension.internal.CoreExtensionEntry; +import org.apache.maven.internal.aether.DefaultRepositorySystemSessionFactory; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver; +import org.codehaus.plexus.DefaultPlexusContainer; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.classworlds.ClassWorld; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; +import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator; + +@Named +public class BootstrapCoreExtensionManager +{ + private final Logger log; + + private final DefaultPluginDependenciesResolver pluginDependenciesResolver; + + private final DefaultRepositorySystemSessionFactory repositorySystemSessionFactory; + + private final ClassWorld classWorld; + + private final ClassRealm parentRealm; + + @Inject + public BootstrapCoreExtensionManager( Logger log, DefaultPluginDependenciesResolver pluginDependenciesResolver, + DefaultRepositorySystemSessionFactory repositorySystemSessionFactory, + PlexusContainer container ) + { + this.log = log; + this.pluginDependenciesResolver = pluginDependenciesResolver; + this.repositorySystemSessionFactory = repositorySystemSessionFactory; + this.classWorld = ( (DefaultPlexusContainer) container ).getClassWorld(); + this.parentRealm = container.getContainerRealm(); + } + + public List loadCoreExtensions( MavenExecutionRequest request, Set providedArtifacts, + List extensions ) + throws Exception + { + RepositorySystemSession repoSession = repositorySystemSessionFactory.newRepositorySession( request ); + List repositories = RepositoryUtils.toRepos( request.getPluginArtifactRepositories() ); + + return resolveCoreExtensions( repoSession, repositories, providedArtifacts, extensions ); + } + + private List resolveCoreExtensions( RepositorySystemSession repoSession, + List repositories, + Set providedArtifacts, + List configuration ) + throws Exception + { + List extensions = new ArrayList(); + + DependencyFilter dependencyFilter = new ExclusionsDependencyFilter( providedArtifacts ); + + for ( CoreExtension extension : configuration ) + { + List artifacts = resolveExtension( extension, repoSession, repositories, dependencyFilter ); + if ( !artifacts.isEmpty() ) + { + extensions.add( createExtension( extension, artifacts ) ); + } + } + + return Collections.unmodifiableList( extensions ); + } + + private CoreExtensionEntry createExtension( CoreExtension extension, List artifacts ) + throws Exception + { + String realmId = + "coreExtension>" + extension.getGroupId() + ":" + extension.getArtifactId() + ":" + extension.getVersion(); + ClassRealm realm = classWorld.newRealm( realmId, null ); + log.debug( "Populating class realm " + realm.getId() ); + realm.setParentRealm( parentRealm ); + for ( Artifact artifact : artifacts ) + { + File file = artifact.getFile(); + log.debug( " Included " + file ); + realm.addURL( file.toURI().toURL() ); + } + return CoreExtensionEntry.discoverFrom( realm, Collections.singleton( artifacts.get( 0 ).getFile() ) ); + } + + private List resolveExtension( CoreExtension extension, RepositorySystemSession repoSession, + List repositories, DependencyFilter dependencyFilter ) + throws PluginResolutionException + { + Plugin plugin = new Plugin(); + plugin.setGroupId( extension.getGroupId() ); + plugin.setArtifactId( extension.getArtifactId() ); + plugin.setVersion( extension.getVersion() ); + + DependencyNode root = + pluginDependenciesResolver.resolveCoreExtension( plugin, dependencyFilter, repositories, repoSession ); + PreorderNodeListGenerator nlg = new PreorderNodeListGenerator(); + root.accept( nlg ); + List artifacts = nlg.getArtifacts( false ); + + return artifacts; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/BaseSlf4jConfiguration.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/BaseSlf4jConfiguration.java new file mode 100644 index 00000000..33e9920e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/BaseSlf4jConfiguration.java @@ -0,0 +1,45 @@ +package org.apache.maven.cli.logging; + +/* + * 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. + */ + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Abstract implementation. + * + * @author Hervé Boutemy + * @since 3.1.0 + */ +public class BaseSlf4jConfiguration + implements Slf4jConfiguration +{ + private final Logger logger = LoggerFactory.getLogger( BaseSlf4jConfiguration.class ); + + public void setRootLoggerLevel( Level level ) + { + logger.warn( "setRootLoggerLevel: operation not supported" ); + } + + public void activate() + { + logger.warn( "reset(): operation not supported" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jConfiguration.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jConfiguration.java new file mode 100644 index 00000000..5f4b64d3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jConfiguration.java @@ -0,0 +1,47 @@ +package org.apache.maven.cli.logging; + +/* + * 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. + */ + +/** + * Interface for configuration operations on loggers, which are not available in slf4j, then require per-slf4f-binding + * implementation. + * + * @author Hervé Boutemy + * @since 3.1.0 + */ +public interface Slf4jConfiguration +{ + public static enum Level + { + DEBUG, INFO, ERROR + } + + /** + * Set root logging level. + * + * @param level the level + */ + void setRootLoggerLevel( Level level ); + + /** + * Activate logging implementation configuration (if necessary). + */ + void activate(); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jConfigurationFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jConfigurationFactory.java new file mode 100644 index 00000000..b50d9442 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jConfigurationFactory.java @@ -0,0 +1,91 @@ +package org.apache.maven.cli.logging; + +/* + * 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. + */ + +import java.io.IOException; +import java.net.URL; +import java.util.Enumeration; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import org.apache.maven.cli.logging.impl.UnsupportedSlf4jBindingConfiguration; +import org.codehaus.plexus.util.PropertyUtils; +import org.slf4j.ILoggerFactory; + +/** + * Slf4jConfiguration factory, loading implementations from META-INF/maven/slf4j-configuration.properties + * configuration files in class loader: key is the class name of the ILoggerFactory, value is the class name of + * the corresponding Slf4jConfiguration. + * + * @author Hervé Boutemy + * @since 3.1.0 + */ +public class Slf4jConfigurationFactory +{ + public static final String RESOURCE = "META-INF/maven/slf4j-configuration.properties"; + + public static Slf4jConfiguration getConfiguration( ILoggerFactory loggerFactory ) + { + Map> supported = new LinkedHashMap>(); + + String slf4jBinding = loggerFactory.getClass().getCanonicalName(); + + try + { + Enumeration resources = Slf4jConfigurationFactory.class.getClassLoader().getResources( RESOURCE ); + + while ( resources.hasMoreElements() ) + { + URL resource = resources.nextElement(); + + Properties conf = PropertyUtils.loadProperties( resource.openStream() ); + + String impl = conf.getProperty( slf4jBinding ); + + if ( impl != null ) + { + return (Slf4jConfiguration) Class.forName( impl ).newInstance(); + } + + supported.put( resource, conf.keySet() ); + } + } + catch ( IOException e ) + { + e.printStackTrace(); + } + catch ( InstantiationException e ) + { + e.printStackTrace(); + } + catch ( IllegalAccessException e ) + { + e.printStackTrace(); + } + catch ( ClassNotFoundException e ) + { + e.printStackTrace(); + } + + return new UnsupportedSlf4jBindingConfiguration( slf4jBinding, supported ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLogger.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLogger.java new file mode 100644 index 00000000..39574642 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLogger.java @@ -0,0 +1,145 @@ +package org.apache.maven.cli.logging; + +/* + * 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. + */ + +import org.codehaus.plexus.logging.Logger; + +/** + * Adapt an SLF4J logger to a Plexus logger, ignoring Plexus logger API parts that are not classical and + * probably not really used. + * + * @author Jason van Zyl + * @since 3.1.0 + */ +public class Slf4jLogger + implements Logger +{ + + private org.slf4j.Logger logger; + + public Slf4jLogger( org.slf4j.Logger logger ) + { + this.logger = logger; + } + + public void debug( String message ) + { + logger.debug( message ); + } + + public void debug( String message, Throwable throwable ) + { + logger.debug( message, throwable ); + } + + public boolean isDebugEnabled() + { + return logger.isDebugEnabled(); + } + + public void info( String message ) + { + logger.info( message ); + } + + public void info( String message, Throwable throwable ) + { + logger.info( message, throwable ); + } + + public boolean isInfoEnabled() + { + return logger.isInfoEnabled(); + } + + public void warn( String message ) + { + logger.warn( message ); + } + + public void warn( String message, Throwable throwable ) + { + logger.warn( message, throwable ); + } + + public boolean isWarnEnabled() + { + return logger.isWarnEnabled(); + } + + public void error( String message ) + { + logger.error( message ); + } + + public void error( String message, Throwable throwable ) + { + logger.error( message, throwable ); + } + + public boolean isErrorEnabled() + { + return logger.isErrorEnabled(); + } + + public void fatalError( String message ) + { + logger.error( message ); + } + + public void fatalError( String message, Throwable throwable ) + { + logger.error( message, throwable ); + } + + public boolean isFatalErrorEnabled() + { + return logger.isErrorEnabled(); + } + + /** + * Warning: ignored (always return 0 == Logger.LEVEL_DEBUG). + */ + public int getThreshold() + { + return 0; + } + + /** + * Warning: ignored. + */ + public void setThreshold( int threshold ) + { + } + + /** + * Warning: ignored (always return null). + */ + public Logger getChildLogger( String name ) + { + return null; + } + + public String getName() + { + return logger.getName(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLoggerManager.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLoggerManager.java new file mode 100644 index 00000000..529f19eb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLoggerManager.java @@ -0,0 +1,111 @@ +package org.apache.maven.cli.logging; + +/* + * 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. + */ + +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.logging.LoggerManager; +import org.slf4j.ILoggerFactory; +import org.slf4j.LoggerFactory; + +/** + * Use an SLF4J {@link org.slf4j.ILoggerFactory} as a backing for a Plexus + * {@link org.codehaus.plexus.logging.LoggerManager}, + * ignoring Plexus logger API parts that are not classical and probably not really used. + * + * @author Jason van Zyl + * @since 3.1 + */ +public class Slf4jLoggerManager + implements LoggerManager +{ + + private ILoggerFactory loggerFactory; + + public Slf4jLoggerManager() + { + loggerFactory = LoggerFactory.getILoggerFactory(); + } + + public Logger getLoggerForComponent( String role ) + { + return new Slf4jLogger( loggerFactory.getLogger( role ) ); + } + + /** + * The logger name for a component with a non-null hint is role.hint. + * Warning: this does not conform to logger name as class name convention. + * (and what about null and default hint equivalence?) + */ + public Logger getLoggerForComponent( String role, String hint ) + { + return ( null == hint + ? getLoggerForComponent( role ) + : new Slf4jLogger( loggerFactory.getLogger( role + '.' + hint ) ) ); + } + + // + // Trying to give loggers back is a bad idea. Ceki said so :-) + // notice to self: what was this method supposed to do? + // + /** + * Warning: ignored. + */ + public void returnComponentLogger( String role ) + { + } + + /** + * Warning: ignored. + */ + public void returnComponentLogger( String role, String hint ) + { + } + + /** + * Warning: ignored (always return 0). + */ + public int getThreshold() + { + return 0; + } + + /** + * Warning: ignored. + */ + public void setThreshold( int threshold ) + { + } + + /** + * Warning: ignored. + */ + public void setThresholds( int threshold ) + { + } + + /** + * Warning: ignored (always return 0). + */ + public int getActiveLoggerCount() + { + return 0; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jStdoutLogger.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jStdoutLogger.java new file mode 100644 index 00000000..64b9bfde --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jStdoutLogger.java @@ -0,0 +1,306 @@ +package org.apache.maven.cli.logging; + +/* + * 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. + */ + +import java.io.PrintStream; + +import org.slf4j.Logger; +import org.slf4j.Marker; + +/** + * @since 3.1.0 + */ +public class Slf4jStdoutLogger + implements Logger +{ + private static final String ERROR = "[ERROR] "; + + private PrintStream out = System.out; + + // + // These are the only methods we need in our primordial logger + // + public void error( String msg ) + { + out.print( ERROR ); + out.println( msg ); + } + + public void error( String msg, Throwable t ) + { + error( msg ); + + if ( null != t ) + { + t.printStackTrace( out ); + } + } + + // + // Don't need any of this + // + public String getName() + { + return null; + } + + public boolean isTraceEnabled() + { + return false; + } + + public void trace( String msg ) + { + } + + public void trace( String format, Object arg ) + { + } + + public void trace( String format, Object arg1, Object arg2 ) + { + } + + public void trace( String format, Object... arguments ) + { + } + + public void trace( String msg, Throwable t ) + { + } + + public boolean isTraceEnabled( Marker marker ) + { + return false; + } + + public void trace( Marker marker, String msg ) + { + } + + public void trace( Marker marker, String format, Object arg ) + { + } + + public void trace( Marker marker, String format, Object arg1, Object arg2 ) + { + } + + public void trace( Marker marker, String format, Object... argArray ) + { + } + + public void trace( Marker marker, String msg, Throwable t ) + { + } + + public boolean isDebugEnabled() + { + return false; + } + + public void debug( String msg ) + { + } + + public void debug( String format, Object arg ) + { + } + + public void debug( String format, Object arg1, Object arg2 ) + { + } + + public void debug( String format, Object... arguments ) + { + } + + public void debug( String msg, Throwable t ) + { + } + + public boolean isDebugEnabled( Marker marker ) + { + return false; + } + + public void debug( Marker marker, String msg ) + { + } + + public void debug( Marker marker, String format, Object arg ) + { + } + + public void debug( Marker marker, String format, Object arg1, Object arg2 ) + { + } + + public void debug( Marker marker, String format, Object... arguments ) + { + } + + public void debug( Marker marker, String msg, Throwable t ) + { + } + + public boolean isInfoEnabled() + { + return false; + } + + public void info( String msg ) + { + } + + public void info( String format, Object arg ) + { + } + + public void info( String format, Object arg1, Object arg2 ) + { + } + + public void info( String format, Object... arguments ) + { + } + + public void info( String msg, Throwable t ) + { + } + + public boolean isInfoEnabled( Marker marker ) + { + return false; + } + + public void info( Marker marker, String msg ) + { + } + + public void info( Marker marker, String format, Object arg ) + { + } + + public void info( Marker marker, String format, Object arg1, Object arg2 ) + { + } + + public void info( Marker marker, String format, Object... arguments ) + { + } + + public void info( Marker marker, String msg, Throwable t ) + { + } + + public boolean isWarnEnabled() + { + return false; + } + + public void warn( String msg ) + { + } + + public void warn( String format, Object arg ) + { + } + + public void warn( String format, Object... arguments ) + { + } + + public void warn( String format, Object arg1, Object arg2 ) + { + } + + public void warn( String msg, Throwable t ) + { + } + + public boolean isWarnEnabled( Marker marker ) + { + return false; + } + + public void warn( Marker marker, String msg ) + { + } + + public void warn( Marker marker, String format, Object arg ) + { + } + + public void warn( Marker marker, String format, Object arg1, Object arg2 ) + { + } + + public void warn( Marker marker, String format, Object... arguments ) + { + } + + public void warn( Marker marker, String msg, Throwable t ) + { + } + + public boolean isErrorEnabled() + { + return false; + } + + public void error( String format, Object arg ) + { + } + + public void error( String format, Object arg1, Object arg2 ) + { + } + + public void error( String format, Object... arguments ) + { + } + + public boolean isErrorEnabled( Marker marker ) + { + return false; + } + + public void error( Marker marker, String msg ) + { + } + + public void error( Marker marker, String format, Object arg ) + { + } + + public void error( Marker marker, String format, Object arg1, Object arg2 ) + { + } + + public void error( Marker marker, String format, Object... arguments ) + { + } + + public void error( Marker marker, String msg, Throwable t ) + { + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Log4j2Configuration.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Log4j2Configuration.java new file mode 100644 index 00000000..b24ea9cf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Log4j2Configuration.java @@ -0,0 +1,59 @@ +package org.apache.maven.cli.logging.impl; + +/* + * 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. + */ + +import org.apache.maven.cli.logging.BaseSlf4jConfiguration; + +/** + * Configuration for slf4j-log4j2. + * + * @author Hervé Boutemy + * @since 3.1.0 + */ +public class Log4j2Configuration + extends BaseSlf4jConfiguration +{ + @Override + public void setRootLoggerLevel( Level level ) + { + String value; + switch ( level ) + { + case DEBUG: + value = "debug"; + break; + + case INFO: + value = "info"; + break; + + default: + value = "error"; + break; + } + System.setProperty( "maven.logging.root.level", value ); + } + + @Override + public void activate() + { + // no op + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java new file mode 100644 index 00000000..5d9fab74 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java @@ -0,0 +1,61 @@ +package org.apache.maven.cli.logging.impl; + +/* + * 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. + */ + +import org.apache.maven.cli.logging.BaseSlf4jConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Configuration for slf4j-logback. + * + * @author Hervé Boutemy + * @since 3.1.0 + */ +public class LogbackConfiguration + extends BaseSlf4jConfiguration +{ + @Override + public void setRootLoggerLevel( Level level ) + { + ch.qos.logback.classic.Level value; + switch ( level ) + { + case DEBUG: + value = ch.qos.logback.classic.Level.DEBUG; + break; + + case INFO: + value = ch.qos.logback.classic.Level.INFO; + break; + + default: + value = ch.qos.logback.classic.Level.ERROR; + break; + } + ( (ch.qos.logback.classic.Logger) LoggerFactory.getLogger( Logger.ROOT_LOGGER_NAME ) ).setLevel( value ); + } + + @Override + public void activate() + { + // no op + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java new file mode 100644 index 00000000..3961059d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java @@ -0,0 +1,63 @@ +package org.apache.maven.cli.logging.impl; + +/* + * 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. + */ + +import org.apache.maven.cli.logging.BaseSlf4jConfiguration; +import org.slf4j.MavenSlf4jFriend; +import org.slf4j.impl.MavenSlf4jSimpleFriend; + +/** + * Configuration for slf4j-simple. + * + * @author Hervé Boutemy + * @since 3.1.0 + */ +public class Slf4jSimpleConfiguration + extends BaseSlf4jConfiguration +{ + @Override + public void setRootLoggerLevel( Level level ) + { + String value; + switch ( level ) + { + case DEBUG: + value = "debug"; + break; + + case INFO: + value = "info"; + break; + + default: + value = "error"; + break; + } + System.setProperty( "org.slf4j.simpleLogger.defaultLogLevel", value ); + } + + @Override + public void activate() + { + // property for root logger level or System.out redirection need to be taken into account + MavenSlf4jFriend.reset(); + MavenSlf4jSimpleFriend.init(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java new file mode 100644 index 00000000..2e91b251 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java @@ -0,0 +1,72 @@ +package org.apache.maven.cli.logging.impl; + +/* + * 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. + */ + +import java.net.URL; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.cli.logging.BaseSlf4jConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Pseudo-configuration for unsupported slf4j binding. + * + * @author Hervé Boutemy + * @since 3.2.4 + */ +public class UnsupportedSlf4jBindingConfiguration + extends BaseSlf4jConfiguration +{ + private final Logger logger = LoggerFactory.getLogger( UnsupportedSlf4jBindingConfiguration.class ); + + private String slf4jBinding; + + private Map> supported; + + public UnsupportedSlf4jBindingConfiguration( String slf4jBinding, Map> supported ) + { + this.slf4jBinding = slf4jBinding; + this.supported = supported; + } + + @Override + public void activate() + { + logger.warn( "The SLF4J binding actually used is not supported by Maven: " + slf4jBinding ); + logger.warn( "Maven supported bindings are:" ); + + String ls = System.getProperty( "line.separator" ); + + for ( Map.Entry> entry : supported.entrySet() ) + { + StringBuilder sb = new StringBuilder(); + sb.append( "(from " ).append( entry.getKey().toExternalForm() ).append( ")" ); + + for ( Object binding : entry.getValue() ) + { + sb.append( ls ).append( "- " ).append( binding ); + } + + logger.warn( sb.toString() ); + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java new file mode 100644 index 00000000..58b1a5dc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/AbstractMavenTransferListener.java @@ -0,0 +1,90 @@ +package org.apache.maven.cli.transfer; + +/* + * 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. + */ + +import java.io.PrintStream; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + +import org.eclipse.aether.transfer.AbstractTransferListener; +import org.eclipse.aether.transfer.TransferCancelledException; +import org.eclipse.aether.transfer.TransferEvent; +import org.eclipse.aether.transfer.TransferResource; + +public abstract class AbstractMavenTransferListener + extends AbstractTransferListener +{ + + protected PrintStream out; + + protected AbstractMavenTransferListener( PrintStream out ) + { + this.out = out; + } + + @Override + public void transferInitiated( TransferEvent event ) + { + String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading"; + + out.println( message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName() ); + } + + @Override + public void transferCorrupted( TransferEvent event ) + throws TransferCancelledException + { + TransferResource resource = event.getResource(); + + out.println( "[WARNING] " + event.getException().getMessage() + " for " + resource.getRepositoryUrl() + + resource.getResourceName() ); + } + + @Override + public void transferSucceeded( TransferEvent event ) + { + TransferResource resource = event.getResource(); + long contentLength = event.getTransferredBytes(); + if ( contentLength >= 0 ) + { + String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" ); + String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B"; + + String throughput = ""; + long duration = System.currentTimeMillis() - resource.getTransferStartTime(); + if ( duration > 0 ) + { + DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) ); + double kbPerSec = ( contentLength / 1024.0 ) / ( duration / 1000.0 ); + throughput = " at " + format.format( kbPerSec ) + " KB/sec"; + } + + out.println( type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len + + throughput + ")" ); + } + } + + protected long toKB( long bytes ) + { + return ( bytes + 1023 ) / 1024; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/BatchModeMavenTransferListener.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/BatchModeMavenTransferListener.java new file mode 100644 index 00000000..0e20f17f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/BatchModeMavenTransferListener.java @@ -0,0 +1,32 @@ +package org.apache.maven.cli.transfer; + +/* + * 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. + */ + +import java.io.PrintStream; + +public class BatchModeMavenTransferListener + extends AbstractMavenTransferListener +{ + public BatchModeMavenTransferListener( PrintStream out ) + { + super( out ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java new file mode 100644 index 00000000..46725024 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java @@ -0,0 +1,133 @@ +package org.apache.maven.cli.transfer; + +/* + * 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. + */ + +import java.io.PrintStream; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.eclipse.aether.transfer.TransferCancelledException; +import org.eclipse.aether.transfer.TransferEvent; +import org.eclipse.aether.transfer.TransferResource; + +/** + * Console download progress meter. + * + * @author Brett Porter + */ +public class ConsoleMavenTransferListener + extends AbstractMavenTransferListener +{ + + private Map downloads = new ConcurrentHashMap(); + + private int lastLength; + + public ConsoleMavenTransferListener( PrintStream out ) + { + super( out ); + } + + @Override + public void transferProgressed( TransferEvent event ) + throws TransferCancelledException + { + TransferResource resource = event.getResource(); + downloads.put( resource, event.getTransferredBytes() ); + + StringBuilder buffer = new StringBuilder( 64 ); + + for ( Map.Entry entry : downloads.entrySet() ) + { + long total = entry.getKey().getContentLength(); + Long complete = entry.getValue(); + // NOTE: This null check guards against http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6312056 + if ( complete != null ) + { + buffer.append( getStatus( complete, total ) ).append( " " ); + } + } + + int pad = lastLength - buffer.length(); + lastLength = buffer.length(); + pad( buffer, pad ); + buffer.append( '\r' ); + + out.print( buffer.toString() ); + } + + private String getStatus( long complete, long total ) + { + if ( total >= 1024 ) + { + return toKB( complete ) + "/" + toKB( total ) + " KB "; + } + else if ( total >= 0 ) + { + return complete + "/" + total + " B "; + } + else if ( complete >= 1024 ) + { + return toKB( complete ) + " KB "; + } + else + { + return complete + " B "; + } + } + + private void pad( StringBuilder buffer, int spaces ) + { + String block = " "; + while ( spaces > 0 ) + { + int n = Math.min( spaces, block.length() ); + buffer.append( block, 0, n ); + spaces -= n; + } + } + + @Override + public void transferSucceeded( TransferEvent event ) + { + transferCompleted( event ); + + super.transferSucceeded( event ); + } + + @Override + public void transferFailed( TransferEvent event ) + { + transferCompleted( event ); + + super.transferFailed( event ); + } + + private void transferCompleted( TransferEvent event ) + { + downloads.remove( event.getResource() ); + + StringBuilder buffer = new StringBuilder( 64 ); + pad( buffer, lastLength ); + buffer.append( '\r' ); + out.print( buffer.toString() ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/QuietMavenTransferListener.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/QuietMavenTransferListener.java new file mode 100644 index 00000000..fd9f52cf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/QuietMavenTransferListener.java @@ -0,0 +1,31 @@ +package org.apache.maven.cli.transfer; + +/* + * 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. + */ + +import org.eclipse.aether.transfer.AbstractTransferListener; + +/** + * @author Benjamin Bentmann + */ +public class QuietMavenTransferListener + extends AbstractTransferListener +{ + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/Slf4jMavenTransferListener.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/Slf4jMavenTransferListener.java new file mode 100644 index 00000000..bb72db36 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/apache/maven/cli/transfer/Slf4jMavenTransferListener.java @@ -0,0 +1,97 @@ +package org.apache.maven.cli.transfer; + +/* + * 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. + */ + +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + +import org.eclipse.aether.transfer.AbstractTransferListener; +import org.eclipse.aether.transfer.TransferCancelledException; +import org.eclipse.aether.transfer.TransferEvent; +import org.eclipse.aether.transfer.TransferResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Slf4jMavenTransferListener + extends AbstractTransferListener +{ + + protected final Logger out; + + public Slf4jMavenTransferListener() + { + this.out = LoggerFactory.getLogger( Slf4jMavenTransferListener.class ); + } + + // TODO should we deprecate? + public Slf4jMavenTransferListener( Logger out ) + { + this.out = out; + } + + @Override + public void transferInitiated( TransferEvent event ) + { + String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading"; + + out.info( message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName() ); + } + + @Override + public void transferCorrupted( TransferEvent event ) + throws TransferCancelledException + { + TransferResource resource = event.getResource(); + + out.warn( event.getException().getMessage() + " for " + resource.getRepositoryUrl() + + resource.getResourceName() ); + } + + @Override + public void transferSucceeded( TransferEvent event ) + { + TransferResource resource = event.getResource(); + long contentLength = event.getTransferredBytes(); + if ( contentLength >= 0 ) + { + String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" ); + String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B"; + + String throughput = ""; + long duration = System.currentTimeMillis() - resource.getTransferStartTime(); + if ( duration > 0 ) + { + DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) ); + double kbPerSec = ( contentLength / 1024.0 ) / ( duration / 1000.0 ); + throughput = " at " + format.format( kbPerSec ) + " KB/sec"; + } + + out.info( type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len + + throughput + ")" ); + } + } + + protected long toKB( long bytes ) + { + return ( bytes + 1023 ) / 1024; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/slf4j/MavenSlf4jFriend.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/slf4j/MavenSlf4jFriend.java new file mode 100644 index 00000000..8a430537 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/slf4j/MavenSlf4jFriend.java @@ -0,0 +1,35 @@ +package org.slf4j; + +/* + * 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. + */ + +/** + * Utility for Maven to access Slf4j internals through package access. + * Use with precaution, since this is not normally intended for production use. + */ +public class MavenSlf4jFriend +{ + /** + * Reset Slf4j internal state. + */ + public static void reset() + { + LoggerFactory.reset(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java new file mode 100644 index 00000000..bffd18c6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java @@ -0,0 +1,40 @@ +package org.slf4j.impl; + +/* + * 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. + */ + +import org.slf4j.ILoggerFactory; +import org.slf4j.LoggerFactory; + +/** + * Utility for Maven to access Slf4j-Simple internals through package access. + * Use with precaution, since this is not normally intended for production use. + */ +public class MavenSlf4jSimpleFriend +{ + public static void init() + { + SimpleLogger.init(); + ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory(); + if ( loggerFactory instanceof SimpleLoggerFactory ) + { + ( (SimpleLoggerFactory) loggerFactory ).reset(); + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/mdo/core-extensions.mdo b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/mdo/core-extensions.mdo new file mode 100644 index 00000000..3a8d80ad --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/mdo/core-extensions.mdo @@ -0,0 +1,88 @@ + + + + + + + core-extensions + CoreExtensions + This is a reference for the Core Extensions descriptor.

+

The default location for the Core Extensions descriptor file is ${maven.projectBasedir}/.mvn/extensions.xml

+ ]]>
+ + + + package + org.apache.maven.cli.internal.extension.model + + + + + + CoreExtensions + Extensions to load. + 1.0.0+ + + + extensions + A set of build extensions to use from this project. + 1.0.0+ + + CoreExtension + * + + + + + + CoreExtension + Describes a build extension to utilise. + 1.0.0+ + + + groupId + The group ID of the extension's artifact. + 1.0.0+ + true + String + + + artifactId + The artifact ID of the extension. + 1.0.0+ + true + String + + + version + The version of the extension. + 1.0.0+ + true + String + + + + +
diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/resources/META-INF/MANIFEST.MF b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 00000000..57576ed9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Maven 2.x Embedder Plug-in +Bundle-Vendor: maven.org +Bundle-SymbolicName: org.maven.ide.embedder +Bundle-Version: ${bundleVersion} +Bundle-ClassPath: . diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties new file mode 100644 index 00000000..87418363 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties @@ -0,0 +1,22 @@ +# 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. + +# key = Slf4j effective logger factory implementation +# value = corresponding o.a.m.cli.logging.Slf4jConfiguration class +org.slf4j.impl.SimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration +org.slf4j.helpers.Log4jLoggerFactory org.apache.maven.cli.logging.impl.Log4j2Configuration +ch.qos.logback.classic.LoggerContext org.apache.maven.cli.logging.impl.LogbackConfiguration diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/cli.apt.vm b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/cli.apt.vm new file mode 100644 index 00000000..b5dcae71 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/cli.apt.vm @@ -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. + + ----- + Maven CLI Options Reference + ----- + Hervé Boutemy + ----- + 2012-04-29 + ----- + +Maven CLI Options Reference + +%{snippet|file=${project.basedir}/target/test-classes/options.html|verbatim=false} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/index.apt.vm b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/index.apt.vm new file mode 100644 index 00000000..519fdae2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/index.apt.vm @@ -0,0 +1,42 @@ +~~ 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. + + ----- + ${project.name} + ----- + Hervé Boutemy + ----- + 2015-03-12 + ----- + +${project.name} + + ${project.description} + +* References + + * {{{./cli.html}CLI options}}, + + * {{{./logging.html}logging API}}. + + * since 3.3.0, per project settings can be defined by files in <<<.mvn/>>> directory: + + * <<<.mvn/jvm.config>>> containing jvm options, + + * <<<.mvn/maven.config>>> containing Maven command-line parameter, + + * <<<.mvn/extensions.xml>>> containing {{{./core-extensions.html}a list of extensions}}. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/logging.apt b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/logging.apt new file mode 100644 index 00000000..cc9257d3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/apt/logging.apt @@ -0,0 +1,112 @@ +~~ 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. + + ----- + Maven Logging + ----- + Hervé Boutemy + ----- + 2013-08-02 + ----- + +Maven Logging + + End-user logging documentation is available {{{/maven-logging.html}in Maven site}}. + This documentation is focused on internal implementation details. + +* Logging API + + Maven uses + {{{http://plexus.codehaus.org/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/logging/package-summary.html}Plexus + Container logging API}}, like any other Plexus components, ie + {{{http://plexus.codehaus.org/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/logging/LoggerManager.html}LoggerManager}} + / {{{http://plexus.codehaus.org/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/logging/Logger.html}Logger}}. + + Starting with Maven 3.1.0: + + * Maven supports SLF4J API logging API too, ie {{{http://slf4j.org/apidocs/org/slf4j/LoggerFactory.html}LoggerFactory}} / + {{{http://slf4j.org/apidocs/org/slf4j/Logger.html}Logger}}, + + * instead of implementing Plexus logging API itself with basic output to console, Maven implements it using SLF4J API in + {{{./apidocs/org/apache/maven/cli/logging/Slf4jLoggerManager.html}Slf4jLoggerManager}} + / {{{./apidocs/org/apache/maven/cli/logging/Slf4jLogger.html}Slf4jLogger}}. + + +* Logging Implementation + + Maven 3.1.0 ships bundled with {{{http://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html}SLF4J simple logger}}, + but is ready to use other logging implementations: SLF4J is responsible for loading the implementation, referred to as + {{{http://www.slf4j.org/manual.html#swapping}"SLF4J bindings"}}. + + Logging configuration loading is actually done by logging implementation, without any Maven extensions to support merging + Maven installation configuration with per-user configuration for example: + `${maven.home}/conf/logging` directory was added to core's classpath (see `${maven.home}/bin/m2.conf`). See your implementation + documentation for details on file names, formats, and so on. + + During Maven initialization, Maven tweaks default root logging level to match CLI verbosity choice. Since such feature isn't available + in SLF4J API, logging implementation specific extensions need to be added into Maven to support these CLI options: see + {{{./apidocs/org/apache/maven/cli/logging/Slf4jConfigurationFactory.html}Slf4jConfigurationFactory}} / + {{{./apidocs/org/apache/maven/cli/logging/Slf4jConfiguration.html}Slf4jConfiguration}}. + +* Getting Logger Instance + + Plexus Logger and LoggerManager can be injected in Plexus component using Plexus annotations + ++------+ +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +@Component( role = MyComponent.class ) +public class DefaultMyComponent + implements MyComponent +{ + @Requirement + private Logger logger; + + @Requirement + private LoggerManager loggerManager; +} ++------+ + + Starting with Maven 3.1.0, SLF4J Logger can be used directly too, without Plexus. Of course, this will only work when run under + Maven 3.1.0, then this technique can be used safely only in Maven core components or in plugins/component not requiring + compatibility with previous Maven versions. + ++-----+ +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MyClass +{ + final Logger logger = LoggerFactory.getLogger( MyClass.class ); +} ++-----+ + +* Logger Name + + Before Maven 3.1.0, with logging implementation done in Maven, logger name wasn't used by basic console logging implementation: + they are as-is, without clear convention on when to pass logger from class to class or when to create a new logger. + + Starting with Maven 3.1.0, logging implementation can be of greatest use if logger names are well defined. This definition still + needs to be defined and implemented: + + * classical "class name" pattern? + + * Maven-specific name hierarchy? + + * a mix (some with class name, some with Maven-specific hierarchy)? diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/site.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/site.xml new file mode 100644 index 00000000..71dc6c84 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/site/site.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/pom.xml new file mode 100644 index 00000000..aed15161 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/pom.xml @@ -0,0 +1,48 @@ + + + + + 4.0.0 + org.apache.maven + embedder-test-project + jar + 1.0-SNAPSHOT + Maven Quick Start Archetype + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + + embedderProfile + + true + jason + somnambulance + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.4.3 + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/src/main/java/org/apache/maven/App.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/src/main/java/org/apache/maven/App.java new file mode 100644 index 00000000..3902bac5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/src/main/java/org/apache/maven/App.java @@ -0,0 +1,13 @@ +package org.apache.maven; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/src/test/java/org/apache/maven/AppTest.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/src/test/java/org/apache/maven/AppTest.java new file mode 100644 index 00000000..7a879cec --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/embedder-test-project/src/test/java/org/apache/maven/AppTest.java @@ -0,0 +1,38 @@ +package org.apache.maven; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/plugin/pom.xml new file mode 100644 index 00000000..a0dfb082 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/plugin/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + org.apache.maven.errortest + aggregate-mojo-failure-maven-plugin + maven-plugin + 1 + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..ec251830 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,36 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + * @aggregator + * + * @author jdcasey + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + throw new MojoFailureException( this, "This mojo will always fail.", "This mojo is programmed to fail at all times, to express certain error-reporting functions." ); + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/project/pom.xml new file mode 100644 index 00000000..cddcc140 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/aggregate-mojo-failure/project/pom.xml @@ -0,0 +1,25 @@ + + + + 4.0.0 + org.apache.maven + aggregate-mojo-failure + 1 + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/plugin/pom.xml new file mode 100644 index 00000000..0a0c0d77 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/plugin/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + org.apache.maven.errortest + bad-build-plan-maven-plugin + maven-plugin + 1 + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..b5e6ecd5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,35 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + * @execute goal="my:something:else:that:is:wrong" + * + * @author jdcasey + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/project/pom.xml new file mode 100644 index 00000000..6a4bcda3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-build-plan/project/pom.xml @@ -0,0 +1,25 @@ + + + + 4.0.0 + org.apache.maven + bad-build-plan + 1 + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-dep-version/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-dep-version/pom.xml new file mode 100644 index 00000000..cfd29708 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-dep-version/pom.xml @@ -0,0 +1,33 @@ + + + + 4.0.0 + org.apache.maven + bad-dep-version + 1 + + + + junit + junit + [3.1, + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-direct-deps/local-repo/org/apache/maven/errortest/test-maven-ext/1/test-maven-ext-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-direct-deps/local-repo/org/apache/maven/errortest/test-maven-ext/1/test-maven-ext-1.pom new file mode 100644 index 00000000..dcaf397e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-direct-deps/local-repo/org/apache/maven/errortest/test-maven-ext/1/test-maven-ext-1.pom @@ -0,0 +1,34 @@ + + + + 4.0.0 + org.apache.maven.errortest + test-maven-ext + 1 + + + + junit + junit + [3.8, + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-direct-deps/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-direct-deps/project/pom.xml new file mode 100644 index 00000000..6d06469f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-direct-deps/project/pom.xml @@ -0,0 +1,35 @@ + + + + 4.0.0 + org.apache.maven.errortest + bad-ext-direct-deps + 1 + + + + + org.apache.maven.errortest + test-maven-ext + 1 + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-dep-ver-maven-plugin/1/bad-ext-plugin-dep-ver-maven-plugin-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-dep-ver-maven-plugin/1/bad-ext-plugin-dep-ver-maven-plugin-1.jar new file mode 100644 index 00000000..7d849019 Binary files /dev/null and b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-dep-ver-maven-plugin/1/bad-ext-plugin-dep-ver-maven-plugin-1.jar differ diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-dep-ver-maven-plugin/1/bad-ext-plugin-dep-ver-maven-plugin-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-dep-ver-maven-plugin/1/bad-ext-plugin-dep-ver-maven-plugin-1.pom new file mode 100644 index 00000000..3c7f3f3f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-dep-ver-maven-plugin/1/bad-ext-plugin-dep-ver-maven-plugin-1.pom @@ -0,0 +1,55 @@ + + + 4.0.0 + org.apache.maven.errortest + bad-ext-plugin-dep-ver-maven-plugin + maven-plugin + 1 + + + + org.apache.maven + maven-plugin-api + 2.0 + + + junit + junit + [3.8.1, + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/plugin/pom.xml new file mode 100644 index 00000000..2c3da51d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/plugin/pom.xml @@ -0,0 +1,57 @@ + + + 4.0.0 + org.apache.maven.errortest + bad-ext-plugin-maven-ver-maven-plugin + maven-plugin + 1 + + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..5836f1e0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,33 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + throw new MojoExecutionException( "This is meant to fail." ); + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/project/pom.xml new file mode 100644 index 00000000..9001cdca --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-dep-ver/project/pom.xml @@ -0,0 +1,37 @@ + + + + 4.0.0 + org.apache.maven + bad-ext-plugin-dep-ver + 1 + + + + + org.apache.maven.errortest + bad-ext-plugin-dep-ver-maven-plugin + 1 + true + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/1/bad-ext-plugin-maven-ver-maven-plugin-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/1/bad-ext-plugin-maven-ver-maven-plugin-1.jar new file mode 100644 index 00000000..7d849019 Binary files /dev/null and b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/1/bad-ext-plugin-maven-ver-maven-plugin-1.jar differ diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/1/bad-ext-plugin-maven-ver-maven-plugin-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/1/bad-ext-plugin-maven-ver-maven-plugin-1.pom new file mode 100644 index 00000000..ffe6141e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/1/bad-ext-plugin-maven-ver-maven-plugin-1.pom @@ -0,0 +1,54 @@ + + + 4.0.0 + org.apache.maven.errortest + bad-ext-plugin-maven-ver-maven-plugin + maven-plugin + 1 + + + 10 + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/maven-metadata-local.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/maven-metadata-local.xml new file mode 100644 index 00000000..184a5f7d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/local-repo/org/apache/maven/errortest/bad-ext-plugin-maven-ver-maven-plugin/maven-metadata-local.xml @@ -0,0 +1,12 @@ + + org.apache.maven.errortest + bad-ext-plugin-maven-ver-maven-plugin + + 1 + 1 + + 1 + + 20070331131500 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/plugin/pom.xml new file mode 100644 index 00000000..2c3da51d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/plugin/pom.xml @@ -0,0 +1,57 @@ + + + 4.0.0 + org.apache.maven.errortest + bad-ext-plugin-maven-ver-maven-plugin + maven-plugin + 1 + + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..5836f1e0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,33 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + throw new MojoExecutionException( "This is meant to fail." ); + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/project/pom.xml new file mode 100644 index 00000000..3ab28183 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-ext-plugin-maven-ver/project/pom.xml @@ -0,0 +1,37 @@ + + + + 4.0.0 + org.apache.maven + bad-ext-plugin-maven-ver + 1 + + + + + org.apache.maven.errortest + bad-ext-plugin-maven-ver-maven-plugin + 1 + true + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-maven-version/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-maven-version/pom.xml new file mode 100644 index 00000000..db547ca5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-maven-version/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + org.apache.maven.errortest + bad-maven-version + 1 + + + 10 + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-mg-dep-version/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-mg-dep-version/pom.xml new file mode 100644 index 00000000..4bb4c461 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-mg-dep-version/pom.xml @@ -0,0 +1,35 @@ + + + + 4.0.0 + org.apache.maven + bad-mg-dep-version + 1 + + + + + junit + junit + [3.1, + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-non-dep-version/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-non-dep-version/pom.xml new file mode 100644 index 00000000..dd2cff37 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-non-dep-version/pom.xml @@ -0,0 +1,35 @@ + + + + 4.0.0 + org.apache.maven + bad-non-dep-version + 1 + + + + + junit + junit + [3.1, + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-profile-repo/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-profile-repo/pom.xml new file mode 100644 index 00000000..d7a73754 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-profile-repo/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + org.apache.maven.errortest + bad-profile-repo + 1 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-profile-repo/profiles.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-profile-repo/profiles.xml new file mode 100644 index 00000000..43e20d8b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/bad-profile-repo/profiles.xml @@ -0,0 +1,18 @@ + + + + + test + + + test-repo + http://www.google.com/ + nothing-special + + + + + + test + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/plugin/pom.xml new file mode 100644 index 00000000..73a96583 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/plugin/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + org.apache.maven.errortest + config-rdonly-mojo-param-maven-plugin + maven-plugin + 1 + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..6aa5c335 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,39 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + /** + * @parameter default-value="something" + * @required + * @readonly + */ + private String param; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/project/pom.xml new file mode 100644 index 00000000..e2c74121 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/config-rdonly-mojo-param/project/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + org.apache.maven + config-rdonly-mojo-param + 1 + + + + + org.apache.maven.errortest + config-rdonly-mojo-param-maven-plugin + 1 + + + test-run + initialize + + test + + + something-else + + + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/deploy-repo-creation-err/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/deploy-repo-creation-err/pom.xml new file mode 100644 index 00000000..d766e418 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/deploy-repo-creation-err/pom.xml @@ -0,0 +1,41 @@ + + + + 4.0.0 + org.apache.maven + deploy-repo-creation-err + 1 + + + + junit + junit + 3.8.1 + + + + + + test + http://www.google.com + nothing + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/plugin/pom.xml new file mode 100644 index 00000000..21222df6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/plugin/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + org.apache.maven.errortest + duplicated-attachments-maven-plugin + maven-plugin + 1 + + + org.apache.maven + maven-plugin-api + 2.0 + + + org.apache.maven + maven-project + 2.0.7 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..6b0f61ad --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,50 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.project.MavenProjectHelper; +import org.apache.maven.project.MavenProject; + +/** + * @goal test + * + * @author jdcasey + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + /** + * @component + */ + private MavenProjectHelper mavenProjectHelper; + + /** + * @parameter default-value="${project}" + * @required + * @readonly + */ + private MavenProject project; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + mavenProjectHelper.attachArtifact( project, "pom", "classifier", project.getFile() ); + mavenProjectHelper.attachArtifact( project, "pom", "classifier", project.getFile() ); + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/project/pom.xml new file mode 100644 index 00000000..a9517c94 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/duplicated-attachments/project/pom.xml @@ -0,0 +1,25 @@ + + + + 4.0.0 + org.apache.maven + duplicated-attachments + 1 + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/local-repo/org/apache/maven/errortest/err-loading-plugin-maven-plugin/1/err-loading-plugin-maven-plugin-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/local-repo/org/apache/maven/errortest/err-loading-plugin-maven-plugin/1/err-loading-plugin-maven-plugin-1.jar new file mode 100644 index 00000000..7d849019 Binary files /dev/null and b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/local-repo/org/apache/maven/errortest/err-loading-plugin-maven-plugin/1/err-loading-plugin-maven-plugin-1.jar differ diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/local-repo/org/apache/maven/errortest/err-loading-plugin-maven-plugin/1/err-loading-plugin-maven-plugin-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/local-repo/org/apache/maven/errortest/err-loading-plugin-maven-plugin/1/err-loading-plugin-maven-plugin-1.pom new file mode 100644 index 00000000..7ac04909 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/local-repo/org/apache/maven/errortest/err-loading-plugin-maven-plugin/1/err-loading-plugin-maven-plugin-1.pom @@ -0,0 +1,55 @@ + + + 4.0.0 + org.apache.maven.errortest + err-loading-plugin-maven-plugin + maven-plugin + 1 + + + + org.apache.maven + maven-plugin-api + 2.0 + + + nothing + nothing + 1 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/project/pom.xml new file mode 100644 index 00000000..c210cfba --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-loading-plugin/project/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + org.apache.maven + err-loading-plugin + 1 + + + + + org.apache.maven.errortest + err-loading-plugin-maven-plugin + 1 + + + test-run + initialize + + test + + + + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/dep/1/dep-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/dep/1/dep-1.pom new file mode 100644 index 00000000..e6dd7a2b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/dep/1/dep-1.pom @@ -0,0 +1,16 @@ + + + 4.0.0 + org.apache.maven.errortest + dep + 1 + pom + + + + junit + junit + [4.0,4.1] + + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/err-resolving-ext-plugin-maven-plugin/1/err-resolving-ext-plugin-maven-plugin-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/err-resolving-ext-plugin-maven-plugin/1/err-resolving-ext-plugin-maven-plugin-1.jar new file mode 100644 index 00000000..7d849019 Binary files /dev/null and b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/err-resolving-ext-plugin-maven-plugin/1/err-resolving-ext-plugin-maven-plugin-1.jar differ diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/err-resolving-ext-plugin-maven-plugin/1/err-resolving-ext-plugin-maven-plugin-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/err-resolving-ext-plugin-maven-plugin/1/err-resolving-ext-plugin-maven-plugin-1.pom new file mode 100644 index 00000000..e520ccc9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/local-repo/org/apache/maven/errortest/err-resolving-ext-plugin-maven-plugin/1/err-resolving-ext-plugin-maven-plugin-1.pom @@ -0,0 +1,60 @@ + + + 4.0.0 + org.apache.maven.errortest + err-resolving-ext-plugin-maven-plugin + maven-plugin + 1 + + + + org.apache.maven + maven-plugin-api + 2.0 + + + junit + junit + [3.8.1,3.8.2] + + + org.apache.maven.errortest + dep + 1 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/project/pom.xml new file mode 100644 index 00000000..1339c66c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-ext-plugin/project/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + org.apache.maven.errortest + err-resolving-ext-plugin + 1 + + + + + org.apache.maven.errortest + err-resolving-ext-plugin-maven-plugin + 1 + true + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/local-repo/org/apache/maven/errortest/dep/1/dep-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/local-repo/org/apache/maven/errortest/dep/1/dep-1.pom new file mode 100644 index 00000000..e6dd7a2b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/local-repo/org/apache/maven/errortest/dep/1/dep-1.pom @@ -0,0 +1,16 @@ + + + 4.0.0 + org.apache.maven.errortest + dep + 1 + pom + + + + junit + junit + [4.0,4.1] + + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/pom.xml new file mode 100644 index 00000000..d0b755c6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/pom.xml @@ -0,0 +1,27 @@ + + 4.0.0 + org.apache.maven.errortest + err-resolving-project-dep + 1 + + + + junit + junit + [3.8.1,3.8.2] + + + org.apache.maven.errortest + dep + 1 + pom + + + + + + repo + file://localhost/${basedir}/local-repo + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/src/main/java/org/apache/maven/test/error/mojoFailure/App.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/src/main/java/org/apache/maven/test/error/mojoFailure/App.java new file mode 100644 index 00000000..dd4102a3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/src/main/java/org/apache/maven/test/error/mojoFailure/App.java @@ -0,0 +1,13 @@ +package org.apache.maven.test.error.mojoFailure; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java new file mode 100644 index 00000000..7e0144ac --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/err-resolving-project-dep/project/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java @@ -0,0 +1,38 @@ +package org.apache.maven.test.error.mojoFailure; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/local-repo/org/apache/maven/errortest/test-maven-ext-dep/1/test-maven-ext-dep-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/local-repo/org/apache/maven/errortest/test-maven-ext-dep/1/test-maven-ext-dep-1.pom new file mode 100644 index 00000000..71edcf4d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/local-repo/org/apache/maven/errortest/test-maven-ext-dep/1/test-maven-ext-dep-1.pom @@ -0,0 +1,26 @@ + + + + 4.0.0 + org.apache.maven.errortest + test-maven-ext-dep + 1 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/local-repo/org/apache/maven/errortest/test-maven-ext/1/test-maven-ext-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/local-repo/org/apache/maven/errortest/test-maven-ext/1/test-maven-ext-1.pom new file mode 100644 index 00000000..cd40200d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/local-repo/org/apache/maven/errortest/test-maven-ext/1/test-maven-ext-1.pom @@ -0,0 +1,34 @@ + + + + 4.0.0 + org.apache.maven.errortest + test-maven-ext + 1 + + + + org.apache.maven.errortest + test-maven-ext-dep + 1 + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/project/pom.xml new file mode 100644 index 00000000..8da15606 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-deps-resolve-err/project/pom.xml @@ -0,0 +1,35 @@ + + + + 4.0.0 + org.apache.maven.errortest + ext-deps-resolve-err + 1 + + + + + org.apache.maven.errortest + test-maven-ext + 1 + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-artifact-missing/local-repo/org/apache/maven/errortest/ext-plugin-artifact-missing-maven-plugin/1/ext-plugin-artifact-missing-maven-plugin-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-artifact-missing/local-repo/org/apache/maven/errortest/ext-plugin-artifact-missing-maven-plugin/1/ext-plugin-artifact-missing-maven-plugin-1.pom new file mode 100644 index 00000000..b7f7d529 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-artifact-missing/local-repo/org/apache/maven/errortest/ext-plugin-artifact-missing-maven-plugin/1/ext-plugin-artifact-missing-maven-plugin-1.pom @@ -0,0 +1,55 @@ + + + 4.0.0 + org.apache.maven.errortest + ext-plugin-artifact-missing-maven-plugin + maven-plugin + 1 + + + + org.apache.maven + maven-plugin-api + 2.0 + + + nothing + nothing + 1 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-artifact-missing/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-artifact-missing/project/pom.xml new file mode 100644 index 00000000..6565fd44 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-artifact-missing/project/pom.xml @@ -0,0 +1,37 @@ + + + + 4.0.0 + org.apache.maven + ext-plugin-artifact-missing + 1 + + + + + org.apache.maven.errortest + ext-plugin-artifact-missing-maven-plugin + 1 + true + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/pom.xml new file mode 100644 index 00000000..e8e5218c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + org.apache.maven.errortest + test-maven-ext-plugin + maven-plugin + 1 + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/ComponentOne.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/ComponentOne.java new file mode 100644 index 00000000..49b7686e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/ComponentOne.java @@ -0,0 +1,8 @@ +package org.plugin; + +public class ComponentOne +{ + + private ComponentTwo two; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/ComponentTwo.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/ComponentTwo.java new file mode 100644 index 00000000..0a82f578 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/ComponentTwo.java @@ -0,0 +1,8 @@ +package org.plugin; + +public class ComponentTwo +{ + + private ComponentOne one; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..4b4a1e4d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,39 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + * + * @author jdcasey + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + /** + * @component + */ + private ComponentOne one; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/resources/META-INF/plexus/components.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/resources/META-INF/plexus/components.xml new file mode 100644 index 00000000..ddc1eee5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/plugin/src/main/resources/META-INF/plexus/components.xml @@ -0,0 +1,25 @@ + + + + org.test.ComponentOne + default + org.test.ComponentOne + + + org.test.ComponentTwo + + + + + + org.test.ComponentTwo + default + org.test.ComponentTwo + + + org.test.ComponentOne + + + + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/project/pom.xml new file mode 100644 index 00000000..513e00c8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-realm-error/project/pom.xml @@ -0,0 +1,36 @@ + + + + 4.0.0 + org.apache.maven.errortest + ext-plugin-realm-error + 1 + + + + + org.apache.maven.errortest + test-maven-ext-plugin + 1 + true + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/1/ext-plugin-version-err-maven-plugin-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/1/ext-plugin-version-err-maven-plugin-1.jar new file mode 100644 index 00000000..7d849019 Binary files /dev/null and b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/1/ext-plugin-version-err-maven-plugin-1.jar differ diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/1/ext-plugin-version-err-maven-plugin-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/1/ext-plugin-version-err-maven-plugin-1.pom new file mode 100644 index 00000000..5aab61d9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/1/ext-plugin-version-err-maven-plugin-1.pom @@ -0,0 +1,50 @@ + + + 4.0.0 + org.apache.maven.errortest + ext-plugin-version-err-maven-plugin + maven-plugin + 1 + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/maven-metadata-local.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/maven-metadata-local.xml new file mode 100644 index 00000000..2a3d1c56 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/local-repo/org/apache/maven/errortest/ext-plugin-version-err-maven-plugin/maven-metadata-local.xml @@ -0,0 +1,10 @@ + + org.apache.maven.errortest + ext-plugin-version-err-maven-plugin + + + 1 + + 20070331131500 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/plugin/pom.xml new file mode 100644 index 00000000..2c3da51d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/plugin/pom.xml @@ -0,0 +1,57 @@ + + + 4.0.0 + org.apache.maven.errortest + bad-ext-plugin-maven-ver-maven-plugin + maven-plugin + 1 + + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..5836f1e0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,33 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + throw new MojoExecutionException( "This is meant to fail." ); + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/project/pom.xml new file mode 100644 index 00000000..ad6effce --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-plugin-version-err/project/pom.xml @@ -0,0 +1,36 @@ + + + + 4.0.0 + org.apache.maven + ext-plugin-version-err + 1 + + + + + org.apache.maven.errortest + ext-plugin-version-err-maven-plugin + true + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/pom.xml new file mode 100644 index 00000000..a5677067 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + org.apache.maven.errortest + test-maven-ext + 1 + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/src/main/java/org/ext/App.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/src/main/java/org/ext/App.java new file mode 100644 index 00000000..0701b7ae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/src/main/java/org/ext/App.java @@ -0,0 +1,13 @@ +package org.ext; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/src/main/resources/META-INF/plexus/components.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/src/main/resources/META-INF/plexus/components.xml new file mode 100644 index 00000000..18664051 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/ext/src/main/resources/META-INF/plexus/components.xml @@ -0,0 +1 @@ +this is an error. \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/project/pom.xml new file mode 100644 index 00000000..85e9a9fb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/ext-realm-error/project/pom.xml @@ -0,0 +1,35 @@ + + + + 4.0.0 + org.apache.maven.errortest + ext-realm-error + 1 + + + + + org.apache.maven.errortest + test-maven-ext + 1 + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-model/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-model/pom.xml new file mode 100644 index 00000000..a840870f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-model/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + org.apache.maven.errortest + interp-from-model + ${version} + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-project/project/local-repo/org/test/bad-pom/1/bad-pom-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-project/project/local-repo/org/test/bad-pom/1/bad-pom-1.pom new file mode 100644 index 00000000..b1f29c49 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-project/project/local-repo/org/test/bad-pom/1/bad-pom-1.pom @@ -0,0 +1,9 @@ + + 4.0.0 + org.test + bad-pom + 1 + + ${packaging} + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-project/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-project/project/pom.xml new file mode 100644 index 00000000..bb50b45c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/interp-from-project/project/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + org.apache.maven.errortest + interp-from-project + 1 + + + + org.test + bad-pom + 1 + pom + + + + + + repo + file://localhost/${basedir}/local-repo + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-ioex/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-ioex/pom.xml new file mode 100644 index 00000000..2a924b8c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-ioex/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + org.apache.maven.errortest + load-extern-profiles-ioex + 1 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-xex/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-xex/pom.xml new file mode 100644 index 00000000..fdaa3d43 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-xex/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + org.apache.maven.errortest + load-extern-profiles-xex + 1 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-xex/profiles.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-xex/profiles.xml new file mode 100644 index 00000000..e99fc60b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/load-extern-profiles-xex/profiles.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-direct-invoke-mojo/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-direct-invoke-mojo/plugin/pom.xml new file mode 100644 index 00000000..5895c2a9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-direct-invoke-mojo/plugin/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + org.apache.maven.errortest + missing-direct-invoke-mojo-maven-plugin + maven-plugin + 1 + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-direct-invoke-mojo/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-direct-invoke-mojo/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..bfd8a7f4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-direct-invoke-mojo/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,36 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test-unused + * @aggregator + * + * @author jdcasey + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + throw new MojoFailureException( this, "This mojo will always fail.", "This mojo is programmed to fail at all times, to express certain error-reporting functions." ); + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/pom.xml new file mode 100644 index 00000000..7ff5c598 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/pom.xml @@ -0,0 +1,19 @@ + + + + missing-module-pom + org.apache.maven.errortest + 1 + + 4.0.0 + missing-module-pom-child1 + + + + junit + junit + 3.8.1 + test + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/src/main/java/org/test/App.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/src/main/java/org/test/App.java new file mode 100644 index 00000000..2c825a09 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/src/main/java/org/test/App.java @@ -0,0 +1,13 @@ +package org.test; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/src/test/java/org/test/AppTest.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/src/test/java/org/test/AppTest.java new file mode 100644 index 00000000..e4e81e21 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/child1/src/test/java/org/test/AppTest.java @@ -0,0 +1,38 @@ +package org.test; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/pom.xml new file mode 100644 index 00000000..ff895b80 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-module-pom/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + org.apache.maven.errortest + missing-module-pom + pom + 1 + + + child1 + child2 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-parent-pom/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-parent-pom/pom.xml new file mode 100644 index 00000000..e0ab9f6d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-parent-pom/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + + org.apache.maven.errortest + missing-parent-pom-parent + 1 + + + missing-parent-pom + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/plugin/pom.xml new file mode 100644 index 00000000..6e53240d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/plugin/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + org.apache.maven.errortest + missing-req-mojo-param-maven-plugin + maven-plugin + 1 + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..51b71a87 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,38 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + /** + * @parameter + * @required + */ + private String requiredParam; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/project/pom.xml new file mode 100644 index 00000000..b5c9852b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/missing-req-mojo-param/project/pom.xml @@ -0,0 +1,25 @@ + + + + 4.0.0 + org.apache.maven + missing-req-mojo-param + 1 + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/pom.xml new file mode 100644 index 00000000..de32947a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + org.apache.maven.errortest + mojo-config-error-maven-plugin + 1 + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..5836f1e0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,33 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + throw new MojoExecutionException( "This is meant to fail." ); + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/src/main/resources/META-INF/maven/plugin.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/src/main/resources/META-INF/maven/plugin.xml new file mode 100644 index 00000000..35697de7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/plugin/src/main/resources/META-INF/maven/plugin.xml @@ -0,0 +1,38 @@ + + + org.apache.maven.errortest + mojo-config-error-maven-plugin + 1 + mojo-config-error + false + true + + + test + + false + true + false + false + false + true + org.plugin.TestPlugin + java + per-lookup + once-per-session + + + param + java.lang.String + true + false + + + + + + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/project/pom.xml new file mode 100644 index 00000000..9d63df51 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-config-error/project/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + org.apache.maven + mojo-config-error + 1 + + + + + org.apache.maven.errortest + mojo-config-error-maven-plugin + 1 + + + test-run + initialize + + test + + + + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/plugin/pom.xml new file mode 100644 index 00000000..3347d3c7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/plugin/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + org.apache.maven.errortest + mojo-exec-err-maven-plugin + maven-plugin + 1 + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..5836f1e0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,33 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + throw new MojoExecutionException( "This is meant to fail." ); + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/project/pom.xml new file mode 100644 index 00000000..1f10d0fe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-exec-err/project/pom.xml @@ -0,0 +1,26 @@ + + + + 4.0.0 + org.apache.maven + mojo-exec-err + 1 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/plugin/pom.xml new file mode 100644 index 00000000..66adaf00 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/plugin/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + org.apache.maven.errortest + mojo-lookup-err-maven-plugin + maven-plugin + 1 + + + org.apache.maven + maven-plugin-api + 2.0 + + + org.apache.maven + maven-project + 2.0 + + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + maven-plugin-plugin + 2.3 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/plugin/src/main/java/org/plugin/TestPlugin.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/plugin/src/main/java/org/plugin/TestPlugin.java new file mode 100644 index 00000000..bc2e712d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/plugin/src/main/java/org/plugin/TestPlugin.java @@ -0,0 +1,42 @@ +package org.plugin; + +import org.apache.maven.plugin.Mojo; +import org.apache.maven.project.MavenProject; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +/** + * @goal test + * @requiresProject false + * + * @author jdcasey + */ +public class TestPlugin + implements Mojo +{ + + private Log log; + + /** + * @component role-hint="nonexistant" + */ + private MavenProject project; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + throw new MojoExecutionException( "THIS SHOULD NEVER BE CALLED." ); + } + + public Log getLog() + { + return log; + } + + public void setLog( Log log ) + { + this.log = log; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/project/pom.xml new file mode 100644 index 00000000..cddcc140 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/mojo-lookup-err/project/pom.xml @@ -0,0 +1,25 @@ + + + + 4.0.0 + org.apache.maven + aggregate-mojo-failure + 1 + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-ioex/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-ioex/child/pom.xml new file mode 100644 index 00000000..b70261d1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-ioex/child/pom.xml @@ -0,0 +1,10 @@ + + 4.0.0 + + parent-parse-ioex + org.apache.maven.errortest + 1 + + parent-parse-ioex-child + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-ioex/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-ioex/pom.xml new file mode 100644 index 00000000..e69de29b diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-xex/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-xex/child/pom.xml new file mode 100644 index 00000000..3961dd48 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-xex/child/pom.xml @@ -0,0 +1,10 @@ + + 4.0.0 + + parent-parse-xex + org.apache.maven.errortest + 1 + + parent-parse-xex-child + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-xex/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-xex/pom.xml new file mode 100644 index 00000000..7ac14c6c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/parent-parse-xex/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + org.apache.maven.errortest + parent-parse-xex + 1 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-err/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-err/pom.xml new file mode 100644 index 00000000..031ce1e9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-err/pom.xml @@ -0,0 +1,39 @@ + + + + 4.0.0 + org.apache.maven + profile-activator-err + 1 + + + + faulty + + + nothing + + bar + + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/pom.xml new file mode 100644 index 00000000..0f93b9e6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + org.apache.maven.errortest + profile-activator-lookup-err-ext + 1 + + + + + + maven-surefire-plugin + 2.2 + + + maven-deploy-plugin + 2.3 + + + maven-install-plugin + 2.2 + + + maven-resources-plugin + 2.2 + + + maven-jar-plugin + 2.1 + + + maven-compiler-plugin + 2.0.2 + + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/src/main/java/org/ext/App.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/src/main/java/org/ext/App.java new file mode 100644 index 00000000..0701b7ae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/src/main/java/org/ext/App.java @@ -0,0 +1,13 @@ +package org.ext; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/src/main/resources/META-INF/plexus/components.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/src/main/resources/META-INF/plexus/components.xml new file mode 100644 index 00000000..74a2963c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/ext/src/main/resources/META-INF/plexus/components.xml @@ -0,0 +1,16 @@ + + + + + org.apache.maven.profiles.activation.ProfileActivator + faulty + org.ext.App + + + org.apache.maven.artifact.ArtifactResolver + artifactResolver + + + + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/project/pom.xml new file mode 100644 index 00000000..a34b838d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/profile-activator-lookup-err/project/pom.xml @@ -0,0 +1,46 @@ + + + + 4.0.0 + org.apache.maven.errortest + profile-activator-lookup-err + 1 + + + + test-profile + + + java.version + + + + + + + + + org.apache.maven.errortest + profile-activator-lookup-err-ext + 1 + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/mod1/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/mod1/pom.xml new file mode 100644 index 00000000..ebb7ee78 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/mod1/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + + org.apache.maven.errortest + module + 1 + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/mod2/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/mod2/pom.xml new file mode 100644 index 00000000..ebb7ee78 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/mod2/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + + org.apache.maven.errortest + module + 1 + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/pom.xml new file mode 100644 index 00000000..9e11c6d1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-collision/pom.xml @@ -0,0 +1,12 @@ + + 4.0.0 + org.apache.maven.errortest + project-collision + 1 + pom + + + mod1 + mod2 + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-cycle/dep/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-cycle/dep/pom.xml new file mode 100644 index 00000000..eb1f08fd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-cycle/dep/pom.xml @@ -0,0 +1,12 @@ + + 4.0.0 + + + org.apache.maven.errortest + project-cycle + 1 + + + org.apache.maven.errortest + project-cycle-dep + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-cycle/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-cycle/pom.xml new file mode 100644 index 00000000..75c53e7b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-cycle/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + org.apache.maven.errortest + project-cycle + 1 + pom + + + dep + + + + + org.apache.maven.errortest + project-cycle-dep + 1 + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/pom.xml new file mode 100644 index 00000000..3c297ac1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + org.apache.maven.errortest + project-dep-missing + 1 + + + + central + file://${java.io.tmpdir} + + + + + + not + found + 3.8.1 + + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/src/main/java/org/apache/maven/test/error/mojoFailure/App.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/src/main/java/org/apache/maven/test/error/mojoFailure/App.java new file mode 100644 index 00000000..dd4102a3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/src/main/java/org/apache/maven/test/error/mojoFailure/App.java @@ -0,0 +1,13 @@ +package org.apache.maven.test.error.mojoFailure; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java new file mode 100644 index 00000000..7e0144ac --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-dep-missing/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java @@ -0,0 +1,38 @@ +package org.apache.maven.test.error.mojoFailure; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/pom.xml new file mode 100644 index 00000000..9323d4ea --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/pom.xml @@ -0,0 +1,17 @@ + + 4.0.0 + org.apache.maven.test.error + project-mojo-failure + jar + 1 + + + + junit + junit + 3.8.1 + test + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/src/main/java/org/apache/maven/test/error/mojoFailure/App.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/src/main/java/org/apache/maven/test/error/mojoFailure/App.java new file mode 100644 index 00000000..89f091d2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/src/main/java/org/apache/maven/test/error/mojoFailure/App.java @@ -0,0 +1,14 @@ +package org.apache.maven.test.error.mojoFailure; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + StringUtils utils; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java new file mode 100644 index 00000000..7e0144ac --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-mojo-failure/src/test/java/org/apache/maven/test/error/mojoFailure/AppTest.java @@ -0,0 +1,38 @@ +package org.apache.maven.test.error.mojoFailure; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-parse-xex/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-parse-xex/pom.xml new file mode 100644 index 00000000..fd68be6e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-parse-xex/pom.xml @@ -0,0 +1,25 @@ + + + + 4.0.0 + org.apache.maven + project-parse-xex + 1 + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-validation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-validation/pom.xml new file mode 100644 index 00000000..9f66c18b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/project-validation/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + org.apache.maven.errortest + project-validation + 1 + + + + junit + junit + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/repo-creation-err/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/repo-creation-err/pom.xml new file mode 100644 index 00000000..d0574bd0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/error-reporting-projects/repo-creation-err/pom.xml @@ -0,0 +1,41 @@ + + + + 4.0.0 + org.apache.maven + repo-creation-err + 1 + + + + junit + junit + 3.8.1 + + + + + + test + http://www.google.com + nothing + + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/read-with-deps/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/read-with-deps/pom.xml new file mode 100644 index 00000000..169b3921 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/read-with-deps/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + testing + read-with-deps + 1 + + + + tests + dep + 1 + pom + + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/read-with-deps/repo/tests/dep/1/dep-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/read-with-deps/repo/tests/dep/1/dep-1.pom new file mode 100644 index 00000000..175bf210 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/read-with-deps/repo/tests/dep/1/dep-1.pom @@ -0,0 +1,6 @@ + + 4.0.0 + testing + dep + 1 + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/simple-read-project/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/simple-read-project/pom.xml new file mode 100644 index 00000000..9a3f6be4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/eventing-projects/simple-read-project/pom.xml @@ -0,0 +1,6 @@ + + 4.0.0 + testing + simple-read-project + 1 + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/extensions/META-INF/plexus/components.xml b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/extensions/META-INF/plexus/components.xml new file mode 100644 index 00000000..f38af597 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/extensions/META-INF/plexus/components.xml @@ -0,0 +1,28 @@ + + + + + + org.apache.maven.artifact.factory.ArtifactFactory + default + org.apache.maven.embedder.CustomArtifactFactory + + + \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java new file mode 100644 index 00000000..163d9d9d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerTest.java @@ -0,0 +1,108 @@ +package org.apache.maven.cli; + +/* + * 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. + */ + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.apache.commons.cli.Option; +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.util.FileUtils; + +/** + * Pseudo test to generate documentation fragment about supported CLI options. + * TODO such documentation generation code should not be necessary as unit test but should be run + * during site generation (Velocity? Doxia macro?) + */ +public class CLIManagerTest + extends PlexusTestCase +{ + private final static String LS = System.getProperty( "line.separator" ); + + private static class OptionComparator + implements Comparator