From d1244f83309bbbfb26a56c1752e55b4f7f54a569 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 13:45:05 +0530 Subject: [PATCH 01/13] JAVA-49: Removed module maven-all, to be replaced with maven-modules --- maven-all/README.md | 8 - maven-all/compiler-plugin-java-9/README.md | 3 - maven-all/compiler-plugin-java-9/pom.xml | 30 -- .../maven/java9/MavenCompilerPlugin.java | 9 - .../src/main/java/module-info.java | 3 - maven-all/maven-custom-plugin/README.md | 3 - .../counter-maven-plugin/pom.xml | 80 ----- .../validator/DependencyCounterMojo.java | 45 --- .../maven-custom-plugin/usage-example/pom.xml | 51 --- maven-all/maven-unused-dependencies/pom.xml | 47 --- .../UnusedDependenciesExample.java | 17 - maven-all/maven-war-plugin/README.md | 7 - maven-all/maven-war-plugin/pom.xml | 32 -- maven-all/maven/.gitignore | 2 - maven-all/maven/README.md | 18 - maven-all/maven/custom-rule/pom.xml | 68 ---- .../com/baeldung/enforcer/MyCustomRule.java | 43 --- maven-all/maven/input-resources/baeldung.png | Bin 4318 -> 0 bytes maven-all/maven/input-resources/baeldung.txt | 1 - .../maven/input-resources/verifications.xml | 9 - maven-all/maven/maven-enforcer/README.md | 3 - maven-all/maven/maven-enforcer/pom.xml | 75 ----- maven-all/maven/pom.xml | 314 ------------------ maven-all/maven/proxy/README.md | 3 - maven-all/maven/proxy/settings.xml | 43 --- .../security/redirect/settings-security.xml | 6 - .../maven/security/settings-security.xml | 7 - .../com/baeldung/maven/it/RestITCase.java | 24 -- .../com/baeldung/maven/plugins/Foo.java | 10 - .../com/baeldung/maven/it/EndpointConfig.java | 9 - .../com/baeldung/maven/it/RestEndpoint.java | 12 - .../java/com/baeldung/maven/plugins/Data.java | 16 - .../maven/plugins/MultipleSrcFolders.java | 9 - .../maven/src/main/resources/logback.xml | 13 - .../maven/src/main/webapp/WEB-INF/web.xml | 17 - .../com/baeldung/maven/it/Integration.java | 4 - .../java/com/baeldung/maven/it/RestIT.java | 24 -- .../maven/it/RestIntegrationTest.java | 24 -- .../com/baeldung/maven/it/RestJUnitTest.java | 26 -- .../com/baeldung/maven/plugins/DataCheck.java | 15 - .../baeldung/maven/plugins/DataUnitTest.java | 15 - .../src/test/java/testfail/TestFail.java | 18 - maven-all/pom.xml | 25 -- maven-all/profiles/README.md | 7 - maven-all/profiles/pom.xml | 94 ------ maven-all/versions-maven-plugin/README.md | 7 - .../versions-maven-plugin/original/pom.xml | 82 ----- maven-all/versions-maven-plugin/pom.xml | 81 ----- .../versions-maven-plugin/run-the-demo.sh | 74 ----- 49 files changed, 1533 deletions(-) delete mode 100644 maven-all/README.md delete mode 100644 maven-all/compiler-plugin-java-9/README.md delete mode 100644 maven-all/compiler-plugin-java-9/pom.xml delete mode 100644 maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java delete mode 100644 maven-all/compiler-plugin-java-9/src/main/java/module-info.java delete mode 100644 maven-all/maven-custom-plugin/README.md delete mode 100644 maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml delete mode 100644 maven-all/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java delete mode 100644 maven-all/maven-custom-plugin/usage-example/pom.xml delete mode 100644 maven-all/maven-unused-dependencies/pom.xml delete mode 100644 maven-all/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java delete mode 100644 maven-all/maven-war-plugin/README.md delete mode 100644 maven-all/maven-war-plugin/pom.xml delete mode 100644 maven-all/maven/.gitignore delete mode 100644 maven-all/maven/README.md delete mode 100644 maven-all/maven/custom-rule/pom.xml delete mode 100644 maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java delete mode 100644 maven-all/maven/input-resources/baeldung.png delete mode 100644 maven-all/maven/input-resources/baeldung.txt delete mode 100644 maven-all/maven/input-resources/verifications.xml delete mode 100644 maven-all/maven/maven-enforcer/README.md delete mode 100644 maven-all/maven/maven-enforcer/pom.xml delete mode 100644 maven-all/maven/pom.xml delete mode 100644 maven-all/maven/proxy/README.md delete mode 100644 maven-all/maven/proxy/settings.xml delete mode 100644 maven-all/maven/security/redirect/settings-security.xml delete mode 100644 maven-all/maven/security/settings-security.xml delete mode 100644 maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java delete mode 100644 maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java delete mode 100644 maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java delete mode 100644 maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java delete mode 100644 maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java delete mode 100644 maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java delete mode 100644 maven-all/maven/src/main/resources/logback.xml delete mode 100644 maven-all/maven/src/main/webapp/WEB-INF/web.xml delete mode 100644 maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java delete mode 100644 maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java delete mode 100644 maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java delete mode 100644 maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java delete mode 100644 maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java delete mode 100644 maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java delete mode 100644 maven-all/maven/src/test/java/testfail/TestFail.java delete mode 100644 maven-all/pom.xml delete mode 100644 maven-all/profiles/README.md delete mode 100644 maven-all/profiles/pom.xml delete mode 100644 maven-all/versions-maven-plugin/README.md delete mode 100644 maven-all/versions-maven-plugin/original/pom.xml delete mode 100644 maven-all/versions-maven-plugin/pom.xml delete mode 100644 maven-all/versions-maven-plugin/run-the-demo.sh diff --git a/maven-all/README.md b/maven-all/README.md deleted file mode 100644 index b448be2cd0..0000000000 --- a/maven-all/README.md +++ /dev/null @@ -1,8 +0,0 @@ -## Apache Maven - -This module contains articles about Apache Maven. Please refer to its submodules. - -### Relevant Articles - -- [Apache Maven Tutorial](https://www.baeldung.com/maven) -- [Find Unused Maven Dependencies](https://www.baeldung.com/maven-unused-dependencies) diff --git a/maven-all/compiler-plugin-java-9/README.md b/maven-all/compiler-plugin-java-9/README.md deleted file mode 100644 index 0e02d56946..0000000000 --- a/maven-all/compiler-plugin-java-9/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles - -- [Maven Compiler Plugin](https://www.baeldung.com/maven-compiler-plugin) diff --git a/maven-all/compiler-plugin-java-9/pom.xml b/maven-all/compiler-plugin-java-9/pom.xml deleted file mode 100644 index 6baadb451c..0000000000 --- a/maven-all/compiler-plugin-java-9/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - com.baeldung - compiler-plugin-java-9 - 0.0.1-SNAPSHOT - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${compiler.plugin.version} - - ${source.version} - ${target.version} - - - - - - - 3.8.0 - 9 - 9 - - - \ No newline at end of file diff --git a/maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java b/maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java deleted file mode 100644 index b460d6e38c..0000000000 --- a/maven-all/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.baeldung.maven.java9; - -import static javax.xml.XMLConstants.XML_NS_PREFIX; - -public class MavenCompilerPlugin { - public static void main(String[] args) { - System.out.println("The XML namespace prefix is: " + XML_NS_PREFIX); - } -} diff --git a/maven-all/compiler-plugin-java-9/src/main/java/module-info.java b/maven-all/compiler-plugin-java-9/src/main/java/module-info.java deleted file mode 100644 index afc1d45e71..0000000000 --- a/maven-all/compiler-plugin-java-9/src/main/java/module-info.java +++ /dev/null @@ -1,3 +0,0 @@ -module com.baeldung.maven.java9 { - requires java.xml; -} \ No newline at end of file diff --git a/maven-all/maven-custom-plugin/README.md b/maven-all/maven-custom-plugin/README.md deleted file mode 100644 index 55d147c337..0000000000 --- a/maven-all/maven-custom-plugin/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles: - -- [How to Create a Maven Plugin](https://www.baeldung.com/maven-plugin) diff --git a/maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml b/maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml deleted file mode 100644 index 7ddf5b739c..0000000000 --- a/maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - 4.0.0 - com.baeldung - counter-maven-plugin - 0.0.1-SNAPSHOT - counter-maven-plugin Maven Mojo - maven-plugin - http://maven.apache.org - - - Baeldung - https://www.baeldung.com/ - - - - - org.apache.maven - maven-plugin-api - ${maven-plugin-api.version} - - - org.apache.maven.plugin-tools - maven-plugin-annotations - ${maven-plugin-annotations.version} - provided - - - org.apache.maven - maven-project - ${maven-project.version} - - - - - - - - org.apache.maven.plugins - maven-plugin-plugin - ${maven-plugin-plugin.version} - - - org.apache.maven.plugins - maven-site-plugin - ${maven-site-plugin.version} - - - - - - - - - org.apache.maven.plugins - maven-plugin-plugin - - - - report - - - - - - - - - 1.8 - 1.8 - 3.6.2 - 3.6.0 - 2.2.1 - 3.6.0 - 3.8.2 - - - \ No newline at end of file diff --git a/maven-all/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java b/maven-all/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java deleted file mode 100644 index 4bb53b20cf..0000000000 --- a/maven-all/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.baeldung.maven.plugin.validator; - -import java.util.List; - -import org.apache.maven.model.Dependency; -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugins.annotations.LifecyclePhase; -import org.apache.maven.plugins.annotations.Mojo; -import org.apache.maven.plugins.annotations.Parameter; -import org.apache.maven.project.MavenProject; - -/** - * Counts the number of maven dependencies of a project. - * - * It can be filtered by scope. - * - */ -@Mojo(name = "dependency-counter", defaultPhase = LifecyclePhase.COMPILE) -public class DependencyCounterMojo extends AbstractMojo { - - /** - * Scope to filter the dependencies. - */ - @Parameter(property = "scope") - String scope; - - /** - * Gives access to the Maven project information. - */ - @Parameter(defaultValue = "${project}", required = true, readonly = true) - MavenProject project; - - public void execute() throws MojoExecutionException, MojoFailureException { - List dependencies = project.getDependencies(); - - long numDependencies = dependencies.stream() - .filter(d -> (scope == null || scope.isEmpty()) || scope.equals(d.getScope())) - .count(); - - getLog().info("Number of dependencies: " + numDependencies); - } - -} diff --git a/maven-all/maven-custom-plugin/usage-example/pom.xml b/maven-all/maven-custom-plugin/usage-example/pom.xml deleted file mode 100644 index ef6f08a3fb..0000000000 --- a/maven-all/maven-custom-plugin/usage-example/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - com.baeldung - example - 0.0.1-SNAPSHOT - pom - - - - org.apache.commons - commons-lang3 - ${commons.lang3.version} - - - junit - junit - ${junit.version} - test - - - - - - - com.baeldung - counter-maven-plugin - 0.0.1-SNAPSHOT - - - - dependency-counter - - - - - test - - - - - - - 3.9 - 4.12 - - - diff --git a/maven-all/maven-unused-dependencies/pom.xml b/maven-all/maven-unused-dependencies/pom.xml deleted file mode 100644 index 825858e481..0000000000 --- a/maven-all/maven-unused-dependencies/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - 4.0.0 - com.baeldung - maven-unused-dependencies - 0.0.1-SNAPSHOT - - - 3.2.2 - 1.7.25 - 3.1.2 - 3.1 - - - - - commons-collections - commons-collections - ${commons-collections.version} - - - org.slf4j - slf4j-api - ${slf4j-api.version} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - maven-dependency-plugin - ${maven-dependency-plugin.version} - - - - - \ No newline at end of file diff --git a/maven-all/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java b/maven-all/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java deleted file mode 100644 index c9390880ed..0000000000 --- a/maven-all/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.baeldung.mavendependencyplugin; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class UnusedDependenciesExample { - - /** - * When the Maven dependency analyzer analyzes the code, it will see that the slf4j dependency is being used in this method. - * - * @return the slf4j {@link Logger}. - */ - public Logger getLogger() { - return LoggerFactory.getLogger(UnusedDependenciesExample.class); - } - -} diff --git a/maven-all/maven-war-plugin/README.md b/maven-all/maven-war-plugin/README.md deleted file mode 100644 index 09d33772f0..0000000000 --- a/maven-all/maven-war-plugin/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Maven WAR Plugin - -This module contains articles about the Maven WAR Plugin. - -### Relevant Articles - -- [Eclipse Error: web.xml is missing and failOnMissingWebXml is set to true](https://www.baeldung.com/eclipse-error-web-xml-missing) diff --git a/maven-all/maven-war-plugin/pom.xml b/maven-all/maven-war-plugin/pom.xml deleted file mode 100644 index 915be306ca..0000000000 --- a/maven-all/maven-war-plugin/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - 4.0.0 - com.baeldung - maven-war-plugin - 0.0.1-SNAPSHOT - maven-war-plugin - war - - - - - maven-war-plugin - - ${war.plugin.version} - - - false - - - - - - - - false - 3.1.0 - - - \ No newline at end of file diff --git a/maven-all/maven/.gitignore b/maven-all/maven/.gitignore deleted file mode 100644 index bae0b0d7ce..0000000000 --- a/maven-all/maven/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/output-resources -/.idea/ diff --git a/maven-all/maven/README.md b/maven-all/maven/README.md deleted file mode 100644 index c5f46ca184..0000000000 --- a/maven-all/maven/README.md +++ /dev/null @@ -1,18 +0,0 @@ -## Apache Maven - -This module contains articles about core Apache Maven. Articles about other Maven plugins (such as the Maven WAR Plugin) -have their own dedicated modules. - -### Relevant Articles - -- [Guide to the Core Maven Plugins](https://www.baeldung.com/core-maven-plugins) -- [Maven Resources Plugin](https://www.baeldung.com/maven-resources-plugin) -- [Quick Guide to the Maven Surefire Plugin](https://www.baeldung.com/maven-surefire-plugin) -- [The Maven Failsafe Plugin](https://www.baeldung.com/maven-failsafe-plugin) -- [The Maven Verifier Plugin](https://www.baeldung.com/maven-verifier-plugin) -- [The Maven Clean Plugin](https://www.baeldung.com/maven-clean-plugin) -- [Build a Jar with Maven and Ignore the Test Results](https://www.baeldung.com/maven-ignore-test-results) -- [Maven Project with Multiple Source Directories](https://www.baeldung.com/maven-project-multiple-src-directories) -- [Integration Testing with Maven](https://www.baeldung.com/maven-integration-test) -- [Apache Maven Standard Directory Layout](https://www.baeldung.com/maven-directory-structure) -- [Multi-Module Project with Maven](https://www.baeldung.com/maven-multi-module) diff --git a/maven-all/maven/custom-rule/pom.xml b/maven-all/maven/custom-rule/pom.xml deleted file mode 100644 index 6ff984cb85..0000000000 --- a/maven-all/maven/custom-rule/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 4.0.0 - custom-rule - custom-rule - - - com.baeldung - maven - 0.0.1-SNAPSHOT - - - - - - org.apache.maven.enforcer - enforcer-api - ${api.version} - - - org.apache.maven - maven-project - ${maven.version} - - - org.apache.maven - maven-core - ${maven.version} - - - org.apache.maven - maven-artifact - ${maven.version} - - - org.apache.maven - maven-plugin-api - ${maven.version} - - - org.codehaus.plexus - plexus-container-default - ${plexus-container-default.version} - - - - - - - maven-verifier-plugin - ${maven.verifier.version} - - ../input-resources/verifications.xml - false - - - - - - - 3.0.0-M2 - 2.0.9 - 1.0-alpha-9 - - - diff --git a/maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java b/maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java deleted file mode 100644 index db636c2308..0000000000 --- a/maven-all/maven/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2019 PloyRef - * Created by Seun Matt - * on 19 - 2 - 2019 - */ - -package com.baeldung.enforcer; - -import org.apache.maven.enforcer.rule.api.EnforcerRule; -import org.apache.maven.enforcer.rule.api.EnforcerRuleException; -import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; -import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; - -public class MyCustomRule implements EnforcerRule { - - public void execute(EnforcerRuleHelper enforcerRuleHelper) throws EnforcerRuleException { - - try { - - String groupId = (String) enforcerRuleHelper.evaluate("${project.groupId}"); - - if (groupId == null || !groupId.startsWith("com.baeldung")) { - throw new EnforcerRuleException("Project group id does not start with com.baeldung"); - } - - } - catch (ExpressionEvaluationException ex ) { - throw new EnforcerRuleException( "Unable to lookup an expression " + ex.getLocalizedMessage(), ex ); - } - } - - public boolean isCacheable() { - return false; - } - - public boolean isResultValid(EnforcerRule enforcerRule) { - return false; - } - - public String getCacheId() { - return null; - } -} diff --git a/maven-all/maven/input-resources/baeldung.png b/maven-all/maven/input-resources/baeldung.png deleted file mode 100644 index 488f52e56e45d7b2b64cd688138f85f6a7dcc0e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4318 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 - - - input-resources/baeldung.txt - Welcome - - - \ No newline at end of file diff --git a/maven-all/maven/maven-enforcer/README.md b/maven-all/maven/maven-enforcer/README.md deleted file mode 100644 index 7515647a3d..0000000000 --- a/maven-all/maven/maven-enforcer/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles - -- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin) \ No newline at end of file diff --git a/maven-all/maven/maven-enforcer/pom.xml b/maven-all/maven/maven-enforcer/pom.xml deleted file mode 100644 index cde37eabd1..0000000000 --- a/maven-all/maven/maven-enforcer/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - 4.0.0 - maven-enforcer - maven-enforcer - - - com.baeldung - maven - 0.0.1-SNAPSHOT - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M2 - - - - - - - - - - enforce - - enforce - - - - - - 3.0 - Invalid Maven version. It should, at least, be 3.0 - - - 1.8 - - - ui - WARN - - - cook - WARN - - - local,base - Missing active profiles - WARN - - - - - - - - - - maven-verifier-plugin - ${maven.verifier.version} - - ../input-resources/verifications.xml - false - - - - - - \ No newline at end of file diff --git a/maven-all/maven/pom.xml b/maven-all/maven/pom.xml deleted file mode 100644 index 0220cf8dfc..0000000000 --- a/maven-all/maven/pom.xml +++ /dev/null @@ -1,314 +0,0 @@ - - - 4.0.0 - maven - 0.0.1-SNAPSHOT - maven - pom - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - ../.. - - - - custom-rule - maven-enforcer - - - - - org.glassfish.jersey.containers - jersey-container-servlet-core - ${jersey.version} - - - org.glassfish.jersey.inject - jersey-hk2 - ${jersey.version} - - - junit - junit - ${junit.version} - test - - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.version} - - - 8999 - - quit - 9000 - - - - start-jetty - pre-integration-test - - start - - - - stop-jetty - post-integration-test - - stop - - - - - - maven-resources-plugin - ${maven.resources.version} - - output-resources - - - input-resources - - *.png - - true - - - - - - maven-compiler-plugin - ${maven.compiler.version} - - ${java.version} - ${java.version} - - -Xlint:unchecked - - - - - maven-surefire-plugin - ${maven.surefire.version} - - - DataTest.java - **/*IntegrationTest - - com.baeldung.maven.it.Integration - - TestFail.java - DataCheck.java - - true - - - - maven-failsafe-plugin - ${maven.failsafe.version} - - - - integration-test - verify - - - - - - - - - maven-verifier-plugin - ${maven.verifier.version} - - input-resources/verifications.xml - - - - - verify - - - - - - maven-clean-plugin - ${maven.clean.version} - - - - output-resources - - - - - - org.codehaus.mojo - build-helper-maven-plugin - ${maven.build.helper.version} - - - generate-sources - - add-source - - - - src/main/another-src - - - - - add-integration-test-source - generate-test-sources - - add-test-source - - - - src/integration-test/java - - - - - add-integration-test-resource - generate-test-resources - - add-test-resource - - - - - src/integration-test/resources - - - - - - - - - - - - default - - - - maven-surefire-plugin - ${maven.surefire.version} - - - DataTest.java - - - TestFail.java - DataCheck.java - - true - - - - - - - failsafe - - - - maven-failsafe-plugin - ${maven.failsafe.version} - - - **/*RestIT - **/RestITCase - - - - - - integration-test - verify - - - - - - - - - surefire - - - - maven-surefire-plugin - ${maven.surefire.version} - - - integration-test - - test - - - - none - - - **/*IntegrationTest - - - - - - - - - - category - - - - maven-failsafe-plugin - ${maven.failsafe.version} - - - **/* - - com.baeldung.maven.it.Integration - - - - - integration-test - verify - - - - - - - - - - - 3.0.2 - 3.8.0 - 2.22.0 - 2.22.0 - 1.1 - 3.0.0 - 3.0.0 - 9.4.11.v20180605 - 2.27 - - - \ No newline at end of file diff --git a/maven-all/maven/proxy/README.md b/maven-all/maven/proxy/README.md deleted file mode 100644 index 9ae1fd6ad5..0000000000 --- a/maven-all/maven/proxy/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles: - -- [Using Maven Behind a Proxy](https://www.baeldung.com/maven-behind-proxy) diff --git a/maven-all/maven/proxy/settings.xml b/maven-all/maven/proxy/settings.xml deleted file mode 100644 index 55a850a6bc..0000000000 --- a/maven-all/maven/proxy/settings.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - BaeldungProxy_Encrypted - true - http - proxy.baeldung.com - 80 - baeldung - {U2iMf+7aJXQHRquuQq6MX+n7GOeh97zB9/4e7kkEQYs=} - internal.baeldung.com|localhost|127.*|[::1] - - - - BaeldungProxy_Authenticated - true - http - proxy.baeldung.com - 80 - baeldung - changeme - internal.baeldung.com|localhost|127.*|[::1] - - - - BaeldungProxy - proxy.baeldung.com - 80 - internal.baeldung.com|localhost|127.*|[::1] - - - - - \ No newline at end of file diff --git a/maven-all/maven/security/redirect/settings-security.xml b/maven-all/maven/security/redirect/settings-security.xml deleted file mode 100644 index 37e91bd1a4..0000000000 --- a/maven-all/maven/security/redirect/settings-security.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - R:\config\settings-security.xml - diff --git a/maven-all/maven/security/settings-security.xml b/maven-all/maven/security/settings-security.xml deleted file mode 100644 index 3ac258e8a5..0000000000 --- a/maven-all/maven/security/settings-security.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - {QFMlh/6WjF8H9po9UD\}0Nv18e527jqWb6mUgIB798n4=} - diff --git a/maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java b/maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java deleted file mode 100644 index aaeeedb661..0000000000 --- a/maven-all/maven/src/integration-test/java/com/baeldung/maven/it/RestITCase.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.maven.it; - -import org.junit.Test; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.util.Scanner; - -import static org.junit.Assert.assertEquals; - -public class RestITCase { - @Test - public void whenSendingGet_thenMessageIsReturned() throws IOException { - String url = "http://localhost:8999"; - URLConnection connection = new URL(url).openConnection(); - try (InputStream response = connection.getInputStream(); - Scanner scanner = new Scanner(response)) { - String responseBody = scanner.nextLine(); - assertEquals("Welcome to Baeldung!", responseBody); - } - } -} diff --git a/maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java b/maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java deleted file mode 100644 index f8a6fe9853..0000000000 --- a/maven-all/maven/src/main/another-src/com/baeldung/maven/plugins/Foo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.baeldung.maven.plugins; - -public class Foo { - - public static String foo() { - return "foo"; - } - -} - diff --git a/maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java b/maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java deleted file mode 100644 index 919210ccff..0000000000 --- a/maven-all/maven/src/main/java/com/baeldung/maven/it/EndpointConfig.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.baeldung.maven.it; - -import org.glassfish.jersey.server.ResourceConfig; - -public class EndpointConfig extends ResourceConfig { - public EndpointConfig() { - register(RestEndpoint.class); - } -} diff --git a/maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java b/maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java deleted file mode 100644 index c234891865..0000000000 --- a/maven-all/maven/src/main/java/com/baeldung/maven/it/RestEndpoint.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.baeldung.maven.it; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; - -@Path("/") -public class RestEndpoint { - @GET - public String hello() { - return "Welcome to Baeldung!"; - } -} diff --git a/maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java b/maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java deleted file mode 100644 index 6ac6f9ab46..0000000000 --- a/maven-all/maven/src/main/java/com/baeldung/maven/plugins/Data.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.maven.plugins; - -import java.util.ArrayList; -import java.util.List; - -public class Data { - List textList = new ArrayList(); - - public void addText(String text) { - textList.add(text); - } - - public List getTextList() { - return this.textList; - } -} diff --git a/maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java b/maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java deleted file mode 100644 index d403918dd3..0000000000 --- a/maven-all/maven/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.baeldung.maven.plugins; - -public class MultipleSrcFolders { - - public static void callFoo() { - Foo.foo(); - } - -} diff --git a/maven-all/maven/src/main/resources/logback.xml b/maven-all/maven/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/maven-all/maven/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/maven-all/maven/src/main/webapp/WEB-INF/web.xml b/maven-all/maven/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 1751ad17a5..0000000000 --- a/maven-all/maven/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - rest-servlet - org.glassfish.jersey.servlet.ServletContainer - - javax.ws.rs.Application - com.baeldung.maven.it.EndpointConfig - - - - rest-servlet - /* - - \ No newline at end of file diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java deleted file mode 100644 index 112ce178ce..0000000000 --- a/maven-all/maven/src/test/java/com/baeldung/maven/it/Integration.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.baeldung.maven.it; - -public interface Integration { -} diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java deleted file mode 100644 index 0115d34f1e..0000000000 --- a/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIT.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.maven.it; - -import org.junit.Test; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.util.Scanner; - -import static org.junit.Assert.assertEquals; - -public class RestIT { - @Test - public void whenSendingGet_thenMessageIsReturned() throws IOException { - String url = "http://localhost:8999"; - URLConnection connection = new URL(url).openConnection(); - try (InputStream response = connection.getInputStream(); - Scanner scanner = new Scanner(response)) { - String responseBody = scanner.nextLine(); - assertEquals("Welcome to Baeldung!", responseBody); - } - } -} diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java deleted file mode 100644 index 2f913c8429..0000000000 --- a/maven-all/maven/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.maven.it; - -import org.junit.Test; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.util.Scanner; - -import static org.junit.Assert.assertEquals; - -public class RestIntegrationTest { - @Test - public void whenSendingGet_thenMessageIsReturned() throws IOException { - String url = "http://localhost:8999"; - URLConnection connection = new URL(url).openConnection(); - try (InputStream response = connection.getInputStream(); - Scanner scanner = new Scanner(response)) { - String responseBody = scanner.nextLine(); - assertEquals("Welcome to Baeldung!", responseBody); - } - } -} diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java b/maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java deleted file mode 100644 index 60995d75bd..0000000000 --- a/maven-all/maven/src/test/java/com/baeldung/maven/it/RestJUnitTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.baeldung.maven.it; - -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.util.Scanner; - -import static org.junit.Assert.assertEquals; - -@Category(Integration.class) -public class RestJUnitTest { - @Test - public void whenSendingGet_thenMessageIsReturned() throws IOException { - String url = "http://localhost:8999"; - URLConnection connection = new URL(url).openConnection(); - try (InputStream response = connection.getInputStream(); - Scanner scanner = new Scanner(response)) { - String responseBody = scanner.nextLine(); - assertEquals("Welcome to Baeldung!", responseBody); - } - } -} diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java b/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java deleted file mode 100644 index 9aaf0fb071..0000000000 --- a/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataCheck.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.maven.plugins; - -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; - -import com.baeldung.maven.plugins.Data; - -public class DataCheck { - @Test - public void whenDataObjectIsCreated_thenItIsNotNull() { - Data data = new Data(); - assertNotNull(data); - } -} diff --git a/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java b/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java deleted file mode 100644 index 197f977fec..0000000000 --- a/maven-all/maven/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.maven.plugins; - -import static org.junit.Assert.assertNull; - -import org.junit.Test; - -import com.baeldung.maven.plugins.Data; - -public class DataUnitTest { - @Test - public void whenDataObjectIsNotCreated_thenItIsNull() { - Data data = null; - assertNull(data); - } -} diff --git a/maven-all/maven/src/test/java/testfail/TestFail.java b/maven-all/maven/src/test/java/testfail/TestFail.java deleted file mode 100644 index 3febd21031..0000000000 --- a/maven-all/maven/src/test/java/testfail/TestFail.java +++ /dev/null @@ -1,18 +0,0 @@ -package testfail; - -import org.junit.Test; -import org.junit.Ignore; - -import static org.junit.Assert.assertNotNull; - -public class TestFail { - - @Ignore //ignored so the entire tutorials build passes - @Test - public void whenMessageAssigned_thenItIsNotNull() { - String message = "hello there"; - message = null; - assertNotNull(message); - } - -} diff --git a/maven-all/pom.xml b/maven-all/pom.xml deleted file mode 100644 index 3a79a2a686..0000000000 --- a/maven-all/pom.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - 4.0.0 - maven-all - 0.0.1-SNAPSHOT - maven-all - pom - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - maven - maven-custom-plugin/counter-maven-plugin - maven-war-plugin - profiles - versions-maven-plugin - - - diff --git a/maven-all/profiles/README.md b/maven-all/profiles/README.md deleted file mode 100644 index cfbe5c397f..0000000000 --- a/maven-all/profiles/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Maven Profiles - -This module contains articles about Maven profiles. - -### Relevant Articles - -- [Guide to Maven Profiles](https://www.baeldung.com/maven-profiles) diff --git a/maven-all/profiles/pom.xml b/maven-all/profiles/pom.xml deleted file mode 100644 index 4ae6d1ee40..0000000000 --- a/maven-all/profiles/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - 4.0.0 - com.baeldung - profiles - 0.0.1-SNAPSHOT - profiles - - - - no-tests - - true - - - - integration-tests - - true - - - - mutation-tests - - - active-on-jdk-11 - - 11 - - - - active-on-windows-10 - - - windows 10 - Windows - amd64 - 10.0 - - - - - active-on-property-environment - - - environment - !test - - - - - active-on-missing-file - - - target/testreport.html - - - - - active-on-present-file - - - target/artifact.jar - - - - - - - - - org.apache.maven.plugins - maven-help-plugin - ${help.plugin.version} - - - show-profiles - compile - - active-profiles - - - - - - - - - 3.2.0 - - - \ No newline at end of file diff --git a/maven-all/versions-maven-plugin/README.md b/maven-all/versions-maven-plugin/README.md deleted file mode 100644 index 19414a2a4b..0000000000 --- a/maven-all/versions-maven-plugin/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Versions Maven Plugin - -This module contains articles about the Versions Maven Plugin. - -### Relevant Articles - -- [Use the Latest Version of a Dependency in Maven](https://www.baeldung.com/maven-dependency-latest-version) diff --git a/maven-all/versions-maven-plugin/original/pom.xml b/maven-all/versions-maven-plugin/original/pom.xml deleted file mode 100644 index f81596661e..0000000000 --- a/maven-all/versions-maven-plugin/original/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - 4.0.0 - com.baeldung - original - 0.0.1-SNAPSHOT - - - - - commons-io - commons-io - ${commons-io.version} - - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - - org.apache.commons - commons-compress - ${commons-compress-version} - - - - commons-beanutils - commons-beanutils - ${commons-beanutils.version} - - - - - - - - org.codehaus.mojo - versions-maven-plugin - ${versions.plugin.version} - - - org.apache.commons:commons-collections4 - - - - - - - - - apache.snapshots - Apache Development Snapshot Repository - https://repository.apache.org/content/repositories/snapshots/ - - false - - - true - - - - - - 1.15 - 2.3 - 4.0 - 3.0 - 1.9.1 - 2.7 - - - \ No newline at end of file diff --git a/maven-all/versions-maven-plugin/pom.xml b/maven-all/versions-maven-plugin/pom.xml deleted file mode 100644 index 9793f55b28..0000000000 --- a/maven-all/versions-maven-plugin/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - 4.0.0 - com.baeldung - versions-maven-plugin - 0.0.1-SNAPSHOT - versions-maven-plugin - - - - commons-io - commons-io - ${commons.io.version} - - - - org.apache.commons - commons-collections4 - ${commons.collections4.version} - - - - org.apache.commons - commons-lang3 - ${commons.lang3.version} - - - - org.apache.commons - commons-compress - ${commons-compress-version} - - - - commons-beanutils - commons-beanutils - ${commons.beanutils.version} - - - - - - - org.codehaus.mojo - versions-maven-plugin - ${versions.plugin.version} - - - org.apache.commons:commons-collections4 - - - - - - - - - apache.snapshots - Apache Development Snapshot Repository - https://repository.apache.org/content/repositories/snapshots/ - - false - - - true - - - - - - 1.15 - 2.3 - 2.7 - 1.9.1 - 3.0 - 4.0 - - - \ No newline at end of file diff --git a/maven-all/versions-maven-plugin/run-the-demo.sh b/maven-all/versions-maven-plugin/run-the-demo.sh deleted file mode 100644 index 89ca871e01..0000000000 --- a/maven-all/versions-maven-plugin/run-the-demo.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -#function to display commands -exe() { echo -e "\$ $@\n" ; "$@" ; } - -TEXT_COLOR='\033[1;33m' #Yellow -NO_COLOR='\033[0m' # No Color - -clear - -echo -e "======================================================================================" -echo -e " Showcase for the BAELDUNG tutorial \"Use the latest version of a dependency in Maven\"" -echo -e " Author: Andrea Ligios" -echo -e "======================================================================================" - -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " Resetting the demo environment (which will be altered during the run): " -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -rm -f pom.xml.versionsBackup -cp original/pom.xml pom.xml -ls -lt pom.* -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " Checking for newer versions of the Maven dependencies:" -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -exe mvn versions:display-dependency-updates -echo -read -p "Press enter to continue" - -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " Updating SNAPSHOT dependencies to their RELEASE version, if any:" -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -exe mvn versions:use-releases -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " A backup has been created automatically:" -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -ls -lt pom.* -echo -read -p "Press enter to continue" - -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " Updating RELEASE dependencies to their *next* RELEASE version:" -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -exe mvn versions:use-next-releases -echo -read -p "Press enter to continue" - -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " Reverting every modification made since the beginning:" -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -exe mvn versions:revert -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " The backup is gone, and the pom.xml contains the initial dependencies:" -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -ls -lt pom.* -echo -read -p "Press enter to continue" - -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " Updating RELEASE dependencies to their *latest* RELEASE version:" -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -exe mvn versions:use-latest-releases -echo -read -p "Press enter to continue" - -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " Committing the modifications to pom.xml:" -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -exe mvn versions:commit -echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" -echo -e " The backup is gone, and the pom.xml contains the latest dependencies:" -echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" -ls -lt pom.* -echo - -echo -e "${TEXT_COLOR}\nThat's all folks!${NO_COLOR}\n" From 2b3869871321fccff472a55812a28b7c386e8976 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 13:45:54 +0530 Subject: [PATCH 02/13] JAVA-49: main pom changes corresponding to module renaming --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7958b31a31..4848b563c6 100644 --- a/pom.xml +++ b/pom.xml @@ -517,7 +517,7 @@ machine-learning mapstruct - maven-all + maven-modules maven-archetype maven-polyglot @@ -1036,7 +1036,7 @@ machine-learning mapstruct - maven-all + maven-modules maven-archetype maven-polyglot From ad9e01c2de48b37e5d35a9013b9c70123049a97c Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 13:46:38 +0530 Subject: [PATCH 03/13] JAVA-49: Moved compiler-plugin-java-9 to maven-modules --- .../compiler-plugin-java-9/README.md | 3 ++ maven-modules/compiler-plugin-java-9/pom.xml | 30 +++++++++++++++++++ .../maven/java9/MavenCompilerPlugin.java | 9 ++++++ .../src/main/java/module-info.java | 3 ++ 4 files changed, 45 insertions(+) create mode 100644 maven-modules/compiler-plugin-java-9/README.md create mode 100644 maven-modules/compiler-plugin-java-9/pom.xml create mode 100644 maven-modules/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java create mode 100644 maven-modules/compiler-plugin-java-9/src/main/java/module-info.java diff --git a/maven-modules/compiler-plugin-java-9/README.md b/maven-modules/compiler-plugin-java-9/README.md new file mode 100644 index 0000000000..0e02d56946 --- /dev/null +++ b/maven-modules/compiler-plugin-java-9/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Maven Compiler Plugin](https://www.baeldung.com/maven-compiler-plugin) diff --git a/maven-modules/compiler-plugin-java-9/pom.xml b/maven-modules/compiler-plugin-java-9/pom.xml new file mode 100644 index 0000000000..6baadb451c --- /dev/null +++ b/maven-modules/compiler-plugin-java-9/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + com.baeldung + compiler-plugin-java-9 + 0.0.1-SNAPSHOT + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${compiler.plugin.version} + + ${source.version} + ${target.version} + + + + + + + 3.8.0 + 9 + 9 + + + \ No newline at end of file diff --git a/maven-modules/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java b/maven-modules/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java new file mode 100644 index 0000000000..b460d6e38c --- /dev/null +++ b/maven-modules/compiler-plugin-java-9/src/main/java/com/baeldung/maven/java9/MavenCompilerPlugin.java @@ -0,0 +1,9 @@ +package com.baeldung.maven.java9; + +import static javax.xml.XMLConstants.XML_NS_PREFIX; + +public class MavenCompilerPlugin { + public static void main(String[] args) { + System.out.println("The XML namespace prefix is: " + XML_NS_PREFIX); + } +} diff --git a/maven-modules/compiler-plugin-java-9/src/main/java/module-info.java b/maven-modules/compiler-plugin-java-9/src/main/java/module-info.java new file mode 100644 index 0000000000..afc1d45e71 --- /dev/null +++ b/maven-modules/compiler-plugin-java-9/src/main/java/module-info.java @@ -0,0 +1,3 @@ +module com.baeldung.maven.java9 { + requires java.xml; +} \ No newline at end of file From dbb25da0b078a1550b0ed0e717bd1626079007ef Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 13:47:27 +0530 Subject: [PATCH 04/13] JAVA-49: Moved maven-custom-plugin to maven-modules --- maven-modules/maven-custom-plugin/README.md | 7 ++ .../counter-maven-plugin/pom.xml | 80 +++++++++++++++++++ .../validator/DependencyCounterMojo.java | 45 +++++++++++ maven-modules/maven-custom-plugin/pom.xml | 21 +++++ .../maven-custom-plugin/usage-example/pom.xml | 51 ++++++++++++ 5 files changed, 204 insertions(+) create mode 100644 maven-modules/maven-custom-plugin/README.md create mode 100644 maven-modules/maven-custom-plugin/counter-maven-plugin/pom.xml create mode 100644 maven-modules/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java create mode 100644 maven-modules/maven-custom-plugin/pom.xml create mode 100644 maven-modules/maven-custom-plugin/usage-example/pom.xml diff --git a/maven-modules/maven-custom-plugin/README.md b/maven-modules/maven-custom-plugin/README.md new file mode 100644 index 0000000000..1889036ce3 --- /dev/null +++ b/maven-modules/maven-custom-plugin/README.md @@ -0,0 +1,7 @@ +## Apache Maven + +This module contains articles about creating a custom plugin in Maven. + +### Relevant Articles + +- [How to Create a Maven Plugin](https://www.baeldung.com/maven-plugin) diff --git a/maven-modules/maven-custom-plugin/counter-maven-plugin/pom.xml b/maven-modules/maven-custom-plugin/counter-maven-plugin/pom.xml new file mode 100644 index 0000000000..7ddf5b739c --- /dev/null +++ b/maven-modules/maven-custom-plugin/counter-maven-plugin/pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + com.baeldung + counter-maven-plugin + 0.0.1-SNAPSHOT + counter-maven-plugin Maven Mojo + maven-plugin + http://maven.apache.org + + + Baeldung + https://www.baeldung.com/ + + + + + org.apache.maven + maven-plugin-api + ${maven-plugin-api.version} + + + org.apache.maven.plugin-tools + maven-plugin-annotations + ${maven-plugin-annotations.version} + provided + + + org.apache.maven + maven-project + ${maven-project.version} + + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + ${maven-plugin-plugin.version} + + + org.apache.maven.plugins + maven-site-plugin + ${maven-site-plugin.version} + + + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + + + + report + + + + + + + + + 1.8 + 1.8 + 3.6.2 + 3.6.0 + 2.2.1 + 3.6.0 + 3.8.2 + + + \ No newline at end of file diff --git a/maven-modules/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java b/maven-modules/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java new file mode 100644 index 0000000000..4bb53b20cf --- /dev/null +++ b/maven-modules/maven-custom-plugin/counter-maven-plugin/src/main/java/com/baeldung/maven/plugin/validator/DependencyCounterMojo.java @@ -0,0 +1,45 @@ +package com.baeldung.maven.plugin.validator; + +import java.util.List; + +import org.apache.maven.model.Dependency; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; + +/** + * Counts the number of maven dependencies of a project. + * + * It can be filtered by scope. + * + */ +@Mojo(name = "dependency-counter", defaultPhase = LifecyclePhase.COMPILE) +public class DependencyCounterMojo extends AbstractMojo { + + /** + * Scope to filter the dependencies. + */ + @Parameter(property = "scope") + String scope; + + /** + * Gives access to the Maven project information. + */ + @Parameter(defaultValue = "${project}", required = true, readonly = true) + MavenProject project; + + public void execute() throws MojoExecutionException, MojoFailureException { + List dependencies = project.getDependencies(); + + long numDependencies = dependencies.stream() + .filter(d -> (scope == null || scope.isEmpty()) || scope.equals(d.getScope())) + .count(); + + getLog().info("Number of dependencies: " + numDependencies); + } + +} diff --git a/maven-modules/maven-custom-plugin/pom.xml b/maven-modules/maven-custom-plugin/pom.xml new file mode 100644 index 0000000000..ad22c735ff --- /dev/null +++ b/maven-modules/maven-custom-plugin/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + maven-custom-plugin + 0.0.1-SNAPSHOT + maven-custom-plugin + pom + + + com.baeldung + maven-modules + 0.0.1-SNAPSHOT + + + + counter-maven-plugin + usage-example + + + \ No newline at end of file diff --git a/maven-modules/maven-custom-plugin/usage-example/pom.xml b/maven-modules/maven-custom-plugin/usage-example/pom.xml new file mode 100644 index 0000000000..f512fc104d --- /dev/null +++ b/maven-modules/maven-custom-plugin/usage-example/pom.xml @@ -0,0 +1,51 @@ + + + 4.0.0 + com.baeldung + usage-example + 0.0.1-SNAPSHOT + pom + + + + org.apache.commons + commons-lang3 + ${commons.lang3.version} + + + junit + junit + ${junit.version} + test + + + + + + + com.baeldung + counter-maven-plugin + 0.0.1-SNAPSHOT + + + + dependency-counter + + + + + test + + + + + + + 3.9 + 4.12 + + + From d9c46907d853c0616ba485dfe5663cb33abb5213 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 13:48:07 +0530 Subject: [PATCH 05/13] JAVA-49: Moved maven-unused-dependencies to maven-modules --- .../maven-unused-dependencies/README.md | 7 +++ .../maven-unused-dependencies/pom.xml | 47 +++++++++++++++++++ .../UnusedDependenciesExample.java | 17 +++++++ 3 files changed, 71 insertions(+) create mode 100644 maven-modules/maven-unused-dependencies/README.md create mode 100644 maven-modules/maven-unused-dependencies/pom.xml create mode 100644 maven-modules/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java diff --git a/maven-modules/maven-unused-dependencies/README.md b/maven-modules/maven-unused-dependencies/README.md new file mode 100644 index 0000000000..53897e8227 --- /dev/null +++ b/maven-modules/maven-unused-dependencies/README.md @@ -0,0 +1,7 @@ +## Apache Maven + +This module contains articles about Unused Maven Dependencies. + +### Relevant Articles + +- [Find Unused Maven Dependencies](https://www.baeldung.com/maven-unused-dependencies) diff --git a/maven-modules/maven-unused-dependencies/pom.xml b/maven-modules/maven-unused-dependencies/pom.xml new file mode 100644 index 0000000000..825858e481 --- /dev/null +++ b/maven-modules/maven-unused-dependencies/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + com.baeldung + maven-unused-dependencies + 0.0.1-SNAPSHOT + + + 3.2.2 + 1.7.25 + 3.1.2 + 3.1 + + + + + commons-collections + commons-collections + ${commons-collections.version} + + + org.slf4j + slf4j-api + ${slf4j-api.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.8 + 1.8 + + + + maven-dependency-plugin + ${maven-dependency-plugin.version} + + + + + \ No newline at end of file diff --git a/maven-modules/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java b/maven-modules/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java new file mode 100644 index 0000000000..c9390880ed --- /dev/null +++ b/maven-modules/maven-unused-dependencies/src/main/java/com/baeldung/mavendependencyplugin/UnusedDependenciesExample.java @@ -0,0 +1,17 @@ +package com.baeldung.mavendependencyplugin; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class UnusedDependenciesExample { + + /** + * When the Maven dependency analyzer analyzes the code, it will see that the slf4j dependency is being used in this method. + * + * @return the slf4j {@link Logger}. + */ + public Logger getLogger() { + return LoggerFactory.getLogger(UnusedDependenciesExample.class); + } + +} From b15fc50991291257d553db881c472bad75f845ea Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 13:49:24 +0530 Subject: [PATCH 06/13] JAVA-49: Moved maven-war-plugin to maven-modules --- maven-modules/maven-war-plugin/README.md | 7 ++++++ maven-modules/maven-war-plugin/pom.xml | 32 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 maven-modules/maven-war-plugin/README.md create mode 100644 maven-modules/maven-war-plugin/pom.xml diff --git a/maven-modules/maven-war-plugin/README.md b/maven-modules/maven-war-plugin/README.md new file mode 100644 index 0000000000..09d33772f0 --- /dev/null +++ b/maven-modules/maven-war-plugin/README.md @@ -0,0 +1,7 @@ +## Maven WAR Plugin + +This module contains articles about the Maven WAR Plugin. + +### Relevant Articles + +- [Eclipse Error: web.xml is missing and failOnMissingWebXml is set to true](https://www.baeldung.com/eclipse-error-web-xml-missing) diff --git a/maven-modules/maven-war-plugin/pom.xml b/maven-modules/maven-war-plugin/pom.xml new file mode 100644 index 0000000000..915be306ca --- /dev/null +++ b/maven-modules/maven-war-plugin/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + com.baeldung + maven-war-plugin + 0.0.1-SNAPSHOT + maven-war-plugin + war + + + + + maven-war-plugin + + ${war.plugin.version} + + + false + + + + + + + + false + 3.1.0 + + + \ No newline at end of file From 33e15c0a63ef6ee785663529990909a3e981fe69 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 13:49:57 +0530 Subject: [PATCH 07/13] JAVA-49: Moved versions-maven-plugin to maven-modules --- maven-modules/versions-maven-plugin/README.md | 7 ++ .../versions-maven-plugin/original/pom.xml | 82 +++++++++++++++++++ maven-modules/versions-maven-plugin/pom.xml | 81 ++++++++++++++++++ .../versions-maven-plugin/run-the-demo.sh | 74 +++++++++++++++++ 4 files changed, 244 insertions(+) create mode 100644 maven-modules/versions-maven-plugin/README.md create mode 100644 maven-modules/versions-maven-plugin/original/pom.xml create mode 100644 maven-modules/versions-maven-plugin/pom.xml create mode 100644 maven-modules/versions-maven-plugin/run-the-demo.sh diff --git a/maven-modules/versions-maven-plugin/README.md b/maven-modules/versions-maven-plugin/README.md new file mode 100644 index 0000000000..19414a2a4b --- /dev/null +++ b/maven-modules/versions-maven-plugin/README.md @@ -0,0 +1,7 @@ +## Versions Maven Plugin + +This module contains articles about the Versions Maven Plugin. + +### Relevant Articles + +- [Use the Latest Version of a Dependency in Maven](https://www.baeldung.com/maven-dependency-latest-version) diff --git a/maven-modules/versions-maven-plugin/original/pom.xml b/maven-modules/versions-maven-plugin/original/pom.xml new file mode 100644 index 0000000000..f81596661e --- /dev/null +++ b/maven-modules/versions-maven-plugin/original/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + com.baeldung + original + 0.0.1-SNAPSHOT + + + + + commons-io + commons-io + ${commons-io.version} + + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + org.apache.commons + commons-compress + ${commons-compress-version} + + + + commons-beanutils + commons-beanutils + ${commons-beanutils.version} + + + + + + + + org.codehaus.mojo + versions-maven-plugin + ${versions.plugin.version} + + + org.apache.commons:commons-collections4 + + + + + + + + + apache.snapshots + Apache Development Snapshot Repository + https://repository.apache.org/content/repositories/snapshots/ + + false + + + true + + + + + + 1.15 + 2.3 + 4.0 + 3.0 + 1.9.1 + 2.7 + + + \ No newline at end of file diff --git a/maven-modules/versions-maven-plugin/pom.xml b/maven-modules/versions-maven-plugin/pom.xml new file mode 100644 index 0000000000..9793f55b28 --- /dev/null +++ b/maven-modules/versions-maven-plugin/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + com.baeldung + versions-maven-plugin + 0.0.1-SNAPSHOT + versions-maven-plugin + + + + commons-io + commons-io + ${commons.io.version} + + + + org.apache.commons + commons-collections4 + ${commons.collections4.version} + + + + org.apache.commons + commons-lang3 + ${commons.lang3.version} + + + + org.apache.commons + commons-compress + ${commons-compress-version} + + + + commons-beanutils + commons-beanutils + ${commons.beanutils.version} + + + + + + + org.codehaus.mojo + versions-maven-plugin + ${versions.plugin.version} + + + org.apache.commons:commons-collections4 + + + + + + + + + apache.snapshots + Apache Development Snapshot Repository + https://repository.apache.org/content/repositories/snapshots/ + + false + + + true + + + + + + 1.15 + 2.3 + 2.7 + 1.9.1 + 3.0 + 4.0 + + + \ No newline at end of file diff --git a/maven-modules/versions-maven-plugin/run-the-demo.sh b/maven-modules/versions-maven-plugin/run-the-demo.sh new file mode 100644 index 0000000000..89ca871e01 --- /dev/null +++ b/maven-modules/versions-maven-plugin/run-the-demo.sh @@ -0,0 +1,74 @@ +#!/bin/bash +#function to display commands +exe() { echo -e "\$ $@\n" ; "$@" ; } + +TEXT_COLOR='\033[1;33m' #Yellow +NO_COLOR='\033[0m' # No Color + +clear + +echo -e "======================================================================================" +echo -e " Showcase for the BAELDUNG tutorial \"Use the latest version of a dependency in Maven\"" +echo -e " Author: Andrea Ligios" +echo -e "======================================================================================" + +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " Resetting the demo environment (which will be altered during the run): " +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +rm -f pom.xml.versionsBackup +cp original/pom.xml pom.xml +ls -lt pom.* +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " Checking for newer versions of the Maven dependencies:" +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +exe mvn versions:display-dependency-updates +echo +read -p "Press enter to continue" + +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " Updating SNAPSHOT dependencies to their RELEASE version, if any:" +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +exe mvn versions:use-releases +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " A backup has been created automatically:" +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +ls -lt pom.* +echo +read -p "Press enter to continue" + +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " Updating RELEASE dependencies to their *next* RELEASE version:" +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +exe mvn versions:use-next-releases +echo +read -p "Press enter to continue" + +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " Reverting every modification made since the beginning:" +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +exe mvn versions:revert +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " The backup is gone, and the pom.xml contains the initial dependencies:" +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +ls -lt pom.* +echo +read -p "Press enter to continue" + +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " Updating RELEASE dependencies to their *latest* RELEASE version:" +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +exe mvn versions:use-latest-releases +echo +read -p "Press enter to continue" + +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " Committing the modifications to pom.xml:" +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +exe mvn versions:commit +echo -e "${TEXT_COLOR}\n--------------------------------------------------------------------------------------" +echo -e " The backup is gone, and the pom.xml contains the latest dependencies:" +echo -e "--------------------------------------------------------------------------------------${NO_COLOR}" +ls -lt pom.* +echo + +echo -e "${TEXT_COLOR}\nThat's all folks!${NO_COLOR}\n" From 3d1290bec63cc44652da5a4b45a2161025bb33e1 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 16:16:16 +0530 Subject: [PATCH 08/13] JAVA-49: Renamed proxy to maven-proxy and moved to maven-modules --- maven-modules/maven-proxy/README.md | 3 ++ maven-modules/maven-proxy/proxy/settings.xml | 43 +++++++++++++++++++ .../security/redirect/settings-security.xml | 6 +++ .../security/settings-security.xml | 7 +++ 4 files changed, 59 insertions(+) create mode 100644 maven-modules/maven-proxy/README.md create mode 100644 maven-modules/maven-proxy/proxy/settings.xml create mode 100644 maven-modules/maven-proxy/security/redirect/settings-security.xml create mode 100644 maven-modules/maven-proxy/security/settings-security.xml diff --git a/maven-modules/maven-proxy/README.md b/maven-modules/maven-proxy/README.md new file mode 100644 index 0000000000..9ae1fd6ad5 --- /dev/null +++ b/maven-modules/maven-proxy/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Using Maven Behind a Proxy](https://www.baeldung.com/maven-behind-proxy) diff --git a/maven-modules/maven-proxy/proxy/settings.xml b/maven-modules/maven-proxy/proxy/settings.xml new file mode 100644 index 0000000000..55a850a6bc --- /dev/null +++ b/maven-modules/maven-proxy/proxy/settings.xml @@ -0,0 +1,43 @@ + + + + + + + BaeldungProxy_Encrypted + true + http + proxy.baeldung.com + 80 + baeldung + {U2iMf+7aJXQHRquuQq6MX+n7GOeh97zB9/4e7kkEQYs=} + internal.baeldung.com|localhost|127.*|[::1] + + + + BaeldungProxy_Authenticated + true + http + proxy.baeldung.com + 80 + baeldung + changeme + internal.baeldung.com|localhost|127.*|[::1] + + + + BaeldungProxy + proxy.baeldung.com + 80 + internal.baeldung.com|localhost|127.*|[::1] + + + + + \ No newline at end of file diff --git a/maven-modules/maven-proxy/security/redirect/settings-security.xml b/maven-modules/maven-proxy/security/redirect/settings-security.xml new file mode 100644 index 0000000000..37e91bd1a4 --- /dev/null +++ b/maven-modules/maven-proxy/security/redirect/settings-security.xml @@ -0,0 +1,6 @@ + + + R:\config\settings-security.xml + diff --git a/maven-modules/maven-proxy/security/settings-security.xml b/maven-modules/maven-proxy/security/settings-security.xml new file mode 100644 index 0000000000..3ac258e8a5 --- /dev/null +++ b/maven-modules/maven-proxy/security/settings-security.xml @@ -0,0 +1,7 @@ + + + {QFMlh/6WjF8H9po9UD\}0Nv18e527jqWb6mUgIB798n4=} + From 25d14b9f04e95c711df5e8d0e74524e3efced542 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 16:17:23 +0530 Subject: [PATCH 09/13] JAVA-49: Renamed profiles to maven-profiles and moved to maven-modules --- maven-modules/maven-profiles/README.md | 7 ++ maven-modules/maven-profiles/pom.xml | 94 ++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 maven-modules/maven-profiles/README.md create mode 100644 maven-modules/maven-profiles/pom.xml diff --git a/maven-modules/maven-profiles/README.md b/maven-modules/maven-profiles/README.md new file mode 100644 index 0000000000..cfbe5c397f --- /dev/null +++ b/maven-modules/maven-profiles/README.md @@ -0,0 +1,7 @@ +## Maven Profiles + +This module contains articles about Maven profiles. + +### Relevant Articles + +- [Guide to Maven Profiles](https://www.baeldung.com/maven-profiles) diff --git a/maven-modules/maven-profiles/pom.xml b/maven-modules/maven-profiles/pom.xml new file mode 100644 index 0000000000..4937bc7c5d --- /dev/null +++ b/maven-modules/maven-profiles/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + com.baeldung + maven-profiles + 0.0.1-SNAPSHOT + maven-profiles + + + + no-tests + + true + + + + integration-tests + + true + + + + mutation-tests + + + active-on-jdk-11 + + 11 + + + + active-on-windows-10 + + + windows 10 + Windows + amd64 + 10.0 + + + + + active-on-property-environment + + + environment + !test + + + + + active-on-missing-file + + + target/testreport.html + + + + + active-on-present-file + + + target/artifact.jar + + + + + + + + + org.apache.maven.plugins + maven-help-plugin + ${help.plugin.version} + + + show-profiles + compile + + active-profiles + + + + + + + + + 3.2.0 + + + \ No newline at end of file From a794bcf0d15573821a64b2e51b014de0f3d16109 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 16:18:00 +0530 Subject: [PATCH 10/13] JAVA-49: new module for core maven plugins --- maven-modules/maven-plugins/.gitignore | 2 + maven-modules/maven-plugins/README.md | 11 ++ .../maven-plugins/custom-rule/pom.xml | 54 +++++++ .../com/baeldung/enforcer/MyCustomRule.java | 43 ++++++ .../input-resources/baeldung.png | Bin 0 -> 4318 bytes .../input-resources/baeldung.txt | 1 + .../input-resources/verifications.xml | 9 ++ .../maven-plugins/maven-enforcer/pom.xml | 75 ++++++++++ maven-modules/maven-plugins/pom.xml | 135 ++++++++++++++++++ 9 files changed, 330 insertions(+) create mode 100644 maven-modules/maven-plugins/.gitignore create mode 100644 maven-modules/maven-plugins/README.md create mode 100644 maven-modules/maven-plugins/custom-rule/pom.xml create mode 100644 maven-modules/maven-plugins/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java create mode 100644 maven-modules/maven-plugins/input-resources/baeldung.png create mode 100644 maven-modules/maven-plugins/input-resources/baeldung.txt create mode 100644 maven-modules/maven-plugins/input-resources/verifications.xml create mode 100644 maven-modules/maven-plugins/maven-enforcer/pom.xml create mode 100644 maven-modules/maven-plugins/pom.xml diff --git a/maven-modules/maven-plugins/.gitignore b/maven-modules/maven-plugins/.gitignore new file mode 100644 index 0000000000..bae0b0d7ce --- /dev/null +++ b/maven-modules/maven-plugins/.gitignore @@ -0,0 +1,2 @@ +/output-resources +/.idea/ diff --git a/maven-modules/maven-plugins/README.md b/maven-modules/maven-plugins/README.md new file mode 100644 index 0000000000..4210a3bb20 --- /dev/null +++ b/maven-modules/maven-plugins/README.md @@ -0,0 +1,11 @@ +## Apache Maven + +This module contains articles about the core Maven plugins. Other Maven plugins (such as the Maven WAR Plugin) have their own dedicated modules. + +### Relevant Articles + +- [Guide to the Core Maven Plugins](https://www.baeldung.com/core-maven-plugins) +- [Maven Resources Plugin](https://www.baeldung.com/maven-resources-plugin) +- [The Maven Verifier Plugin](https://www.baeldung.com/maven-verifier-plugin) +- [The Maven Clean Plugin](https://www.baeldung.com/maven-clean-plugin) +- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin) diff --git a/maven-modules/maven-plugins/custom-rule/pom.xml b/maven-modules/maven-plugins/custom-rule/pom.xml new file mode 100644 index 0000000000..0fb551e71b --- /dev/null +++ b/maven-modules/maven-plugins/custom-rule/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + custom-rule + custom-rule + + + com.baeldung + maven-plugins + 0.0.1-SNAPSHOT + + + + + + org.apache.maven.enforcer + enforcer-api + ${api.version} + + + org.apache.maven + maven-project + ${maven.version} + + + org.apache.maven + maven-core + ${maven.version} + + + org.apache.maven + maven-artifact + ${maven.version} + + + org.apache.maven + maven-plugin-api + ${maven.version} + + + org.codehaus.plexus + plexus-container-default + ${plexus-container-default.version} + + + + + 3.0.0-M2 + 2.0.9 + 1.0-alpha-9 + + + diff --git a/maven-modules/maven-plugins/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java b/maven-modules/maven-plugins/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java new file mode 100644 index 0000000000..db636c2308 --- /dev/null +++ b/maven-modules/maven-plugins/custom-rule/src/main/java/com/baeldung/enforcer/MyCustomRule.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019 PloyRef + * Created by Seun Matt + * on 19 - 2 - 2019 + */ + +package com.baeldung.enforcer; + +import org.apache.maven.enforcer.rule.api.EnforcerRule; +import org.apache.maven.enforcer.rule.api.EnforcerRuleException; +import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; +import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; + +public class MyCustomRule implements EnforcerRule { + + public void execute(EnforcerRuleHelper enforcerRuleHelper) throws EnforcerRuleException { + + try { + + String groupId = (String) enforcerRuleHelper.evaluate("${project.groupId}"); + + if (groupId == null || !groupId.startsWith("com.baeldung")) { + throw new EnforcerRuleException("Project group id does not start with com.baeldung"); + } + + } + catch (ExpressionEvaluationException ex ) { + throw new EnforcerRuleException( "Unable to lookup an expression " + ex.getLocalizedMessage(), ex ); + } + } + + public boolean isCacheable() { + return false; + } + + public boolean isResultValid(EnforcerRule enforcerRule) { + return false; + } + + public String getCacheId() { + return null; + } +} diff --git a/maven-modules/maven-plugins/input-resources/baeldung.png b/maven-modules/maven-plugins/input-resources/baeldung.png new file mode 100644 index 0000000000000000000000000000000000000000..488f52e56e45d7b2b64cd688138f85f6a7dcc0e1 GIT binary patch literal 4318 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 + + + input-resources/baeldung.txt + Welcome + + + \ No newline at end of file diff --git a/maven-modules/maven-plugins/maven-enforcer/pom.xml b/maven-modules/maven-plugins/maven-enforcer/pom.xml new file mode 100644 index 0000000000..01f97a061e --- /dev/null +++ b/maven-modules/maven-plugins/maven-enforcer/pom.xml @@ -0,0 +1,75 @@ + + + 4.0.0 + maven-enforcer + maven-enforcer + + + com.baeldung + maven-plugins + 0.0.1-SNAPSHOT + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M2 + + + + + + + + + + enforce + + enforce + + + + + + 3.0 + Invalid Maven version. It should, at least, be 3.0 + + + 1.8 + + + ui + WARN + + + cook + WARN + + + local,base + Missing active profiles + WARN + + + + + + + + + + maven-verifier-plugin + ${maven.verifier.version} + + ../input-resources/verifications.xml + false + + + + + + \ No newline at end of file diff --git a/maven-modules/maven-plugins/pom.xml b/maven-modules/maven-plugins/pom.xml new file mode 100644 index 0000000000..43bcf1f422 --- /dev/null +++ b/maven-modules/maven-plugins/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + maven-plugins + 0.0.1-SNAPSHOT + maven-plugins + pom + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../.. + + + + + + maven-resources-plugin + ${maven.resources.version} + + output-resources + + + input-resources + + *.png + + true + + + + + + maven-compiler-plugin + ${maven.compiler.version} + + ${java.version} + ${java.version} + + -Xlint:unchecked + + + + + maven-verifier-plugin + ${maven.verifier.version} + + input-resources/verifications.xml + + + + + verify + + + + + + maven-clean-plugin + ${maven.clean.version} + + + + output-resources + + + + + + + + + + default + + + + maven-surefire-plugin + ${maven.surefire.version} + + + DataTest.java + + + TestFail.java + DataCheck.java + + true + + + + + + + surefire + + + + maven-surefire-plugin + ${maven.surefire.version} + + + integration-test + + test + + + + none + + + **/*IntegrationTest + + + + + + + + + + + + 3.0.2 + 3.8.0 + 2.22.0 + 2.22.0 + 1.1 + 3.0.0 + 3.0.0 + + + \ No newline at end of file From 3d2c0cddc0133e3e206149b9fd7a7f8d3aa5dd54 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 16:19:06 +0530 Subject: [PATCH 11/13] JAVA-49: new module for maven integration testing & related plugins --- .../maven-integration-test/.gitignore | 2 + .../maven-integration-test/README.md | 10 + maven-modules/maven-integration-test/pom.xml | 283 ++++++++++++++++++ .../com/baeldung/maven/it/RestITCase.java | 24 ++ .../com/baeldung/maven/it/EndpointConfig.java | 9 + .../com/baeldung/maven/it/RestEndpoint.java | 12 + .../java/com/baeldung/maven/plugins/Data.java | 16 + .../src/main/resources/logback.xml | 13 + .../src/main/webapp/WEB-INF/web.xml | 17 ++ .../com/baeldung/maven/it/Integration.java | 4 + .../java/com/baeldung/maven/it/RestIT.java | 24 ++ .../maven/it/RestIntegrationTest.java | 24 ++ .../com/baeldung/maven/it/RestJUnitTest.java | 26 ++ .../com/baeldung/maven/plugins/DataCheck.java | 15 + .../baeldung/maven/plugins/DataUnitTest.java | 15 + .../src/test/java/testfail/TestFail.java | 18 ++ 16 files changed, 512 insertions(+) create mode 100644 maven-modules/maven-integration-test/.gitignore create mode 100644 maven-modules/maven-integration-test/README.md create mode 100644 maven-modules/maven-integration-test/pom.xml create mode 100644 maven-modules/maven-integration-test/src/integration-test/java/com/baeldung/maven/it/RestITCase.java create mode 100644 maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/EndpointConfig.java create mode 100644 maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/RestEndpoint.java create mode 100644 maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/plugins/Data.java create mode 100644 maven-modules/maven-integration-test/src/main/resources/logback.xml create mode 100644 maven-modules/maven-integration-test/src/main/webapp/WEB-INF/web.xml create mode 100644 maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/Integration.java create mode 100644 maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIT.java create mode 100644 maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java create mode 100644 maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestJUnitTest.java create mode 100644 maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataCheck.java create mode 100644 maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java create mode 100644 maven-modules/maven-integration-test/src/test/java/testfail/TestFail.java diff --git a/maven-modules/maven-integration-test/.gitignore b/maven-modules/maven-integration-test/.gitignore new file mode 100644 index 0000000000..bae0b0d7ce --- /dev/null +++ b/maven-modules/maven-integration-test/.gitignore @@ -0,0 +1,2 @@ +/output-resources +/.idea/ diff --git a/maven-modules/maven-integration-test/README.md b/maven-modules/maven-integration-test/README.md new file mode 100644 index 0000000000..e73a73e61e --- /dev/null +++ b/maven-modules/maven-integration-test/README.md @@ -0,0 +1,10 @@ +## Apache Maven + +This module contains articles about Integration Testing with Maven and related plugins. + +### Relevant Articles + +- [Integration Testing with Maven](https://www.baeldung.com/maven-integration-test) +- [Build a Jar with Maven and Ignore the Test Results](https://www.baeldung.com/maven-ignore-test-results) +- [Quick Guide to the Maven Surefire Plugin](https://www.baeldung.com/maven-surefire-plugin) +- [The Maven Failsafe Plugin](https://www.baeldung.com/maven-failsafe-plugin) \ No newline at end of file diff --git a/maven-modules/maven-integration-test/pom.xml b/maven-modules/maven-integration-test/pom.xml new file mode 100644 index 0000000000..0031230bb1 --- /dev/null +++ b/maven-modules/maven-integration-test/pom.xml @@ -0,0 +1,283 @@ + + + 4.0.0 + maven-integration-test + 0.0.1-SNAPSHOT + maven-integration-test + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../.. + + + + + org.glassfish.jersey.containers + jersey-container-servlet-core + ${jersey.version} + + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey.version} + + + junit + junit + ${junit.version} + test + + + + + + + org.eclipse.jetty + jetty-maven-plugin + ${jetty.version} + + + 8999 + + quit + 9000 + + + + start-jetty + pre-integration-test + + start + + + + stop-jetty + post-integration-test + + stop + + + + + + maven-resources-plugin + ${maven.resources.version} + + output-resources + + + input-resources + + *.png + + true + + + + + + maven-compiler-plugin + ${maven.compiler.version} + + ${java.version} + ${java.version} + + -Xlint:unchecked + + + + + maven-surefire-plugin + ${maven.surefire.version} + + + DataTest.java + **/*IntegrationTest + + com.baeldung.maven.it.Integration + + TestFail.java + DataCheck.java + + true + + + + maven-failsafe-plugin + ${maven.failsafe.version} + + + + integration-test + verify + + + + + + + + + maven-clean-plugin + ${maven.clean.version} + + + + output-resources + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${maven.build.helper.version} + + + add-integration-test-source + generate-test-sources + + add-test-source + + + + src/integration-test/java + + + + + add-integration-test-resource + generate-test-resources + + add-test-resource + + + + + src/integration-test/resources + + + + + + + + + + + + default + + + + maven-surefire-plugin + ${maven.surefire.version} + + + DataTest.java + + + TestFail.java + DataCheck.java + + true + + + + + + + failsafe + + + + maven-failsafe-plugin + ${maven.failsafe.version} + + + **/*RestIT + **/RestITCase + + + + + + integration-test + verify + + + + + + + + + surefire + + + + maven-surefire-plugin + ${maven.surefire.version} + + + integration-test + + test + + + + none + + + **/*IntegrationTest + + + + + + + + + + category + + + + maven-failsafe-plugin + ${maven.failsafe.version} + + + **/* + + com.baeldung.maven.it.Integration + + + + + integration-test + verify + + + + + + + + + + + 3.0.2 + 3.8.0 + 2.22.0 + 2.22.0 + 1.1 + 3.0.0 + 3.0.0 + 9.4.11.v20180605 + 2.27 + + + \ No newline at end of file diff --git a/maven-modules/maven-integration-test/src/integration-test/java/com/baeldung/maven/it/RestITCase.java b/maven-modules/maven-integration-test/src/integration-test/java/com/baeldung/maven/it/RestITCase.java new file mode 100644 index 0000000000..aaeeedb661 --- /dev/null +++ b/maven-modules/maven-integration-test/src/integration-test/java/com/baeldung/maven/it/RestITCase.java @@ -0,0 +1,24 @@ +package com.baeldung.maven.it; + +import org.junit.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.util.Scanner; + +import static org.junit.Assert.assertEquals; + +public class RestITCase { + @Test + public void whenSendingGet_thenMessageIsReturned() throws IOException { + String url = "http://localhost:8999"; + URLConnection connection = new URL(url).openConnection(); + try (InputStream response = connection.getInputStream(); + Scanner scanner = new Scanner(response)) { + String responseBody = scanner.nextLine(); + assertEquals("Welcome to Baeldung!", responseBody); + } + } +} diff --git a/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/EndpointConfig.java b/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/EndpointConfig.java new file mode 100644 index 0000000000..919210ccff --- /dev/null +++ b/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/EndpointConfig.java @@ -0,0 +1,9 @@ +package com.baeldung.maven.it; + +import org.glassfish.jersey.server.ResourceConfig; + +public class EndpointConfig extends ResourceConfig { + public EndpointConfig() { + register(RestEndpoint.class); + } +} diff --git a/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/RestEndpoint.java b/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/RestEndpoint.java new file mode 100644 index 0000000000..c234891865 --- /dev/null +++ b/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/it/RestEndpoint.java @@ -0,0 +1,12 @@ +package com.baeldung.maven.it; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; + +@Path("/") +public class RestEndpoint { + @GET + public String hello() { + return "Welcome to Baeldung!"; + } +} diff --git a/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/plugins/Data.java b/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/plugins/Data.java new file mode 100644 index 0000000000..6ac6f9ab46 --- /dev/null +++ b/maven-modules/maven-integration-test/src/main/java/com/baeldung/maven/plugins/Data.java @@ -0,0 +1,16 @@ +package com.baeldung.maven.plugins; + +import java.util.ArrayList; +import java.util.List; + +public class Data { + List textList = new ArrayList(); + + public void addText(String text) { + textList.add(text); + } + + public List getTextList() { + return this.textList; + } +} diff --git a/maven-modules/maven-integration-test/src/main/resources/logback.xml b/maven-modules/maven-integration-test/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/maven-modules/maven-integration-test/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/maven-modules/maven-integration-test/src/main/webapp/WEB-INF/web.xml b/maven-modules/maven-integration-test/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..1751ad17a5 --- /dev/null +++ b/maven-modules/maven-integration-test/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,17 @@ + + + rest-servlet + org.glassfish.jersey.servlet.ServletContainer + + javax.ws.rs.Application + com.baeldung.maven.it.EndpointConfig + + + + rest-servlet + /* + + \ No newline at end of file diff --git a/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/Integration.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/Integration.java new file mode 100644 index 0000000000..112ce178ce --- /dev/null +++ b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/Integration.java @@ -0,0 +1,4 @@ +package com.baeldung.maven.it; + +public interface Integration { +} diff --git a/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIT.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIT.java new file mode 100644 index 0000000000..0115d34f1e --- /dev/null +++ b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIT.java @@ -0,0 +1,24 @@ +package com.baeldung.maven.it; + +import org.junit.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.util.Scanner; + +import static org.junit.Assert.assertEquals; + +public class RestIT { + @Test + public void whenSendingGet_thenMessageIsReturned() throws IOException { + String url = "http://localhost:8999"; + URLConnection connection = new URL(url).openConnection(); + try (InputStream response = connection.getInputStream(); + Scanner scanner = new Scanner(response)) { + String responseBody = scanner.nextLine(); + assertEquals("Welcome to Baeldung!", responseBody); + } + } +} diff --git a/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java new file mode 100644 index 0000000000..2f913c8429 --- /dev/null +++ b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestIntegrationTest.java @@ -0,0 +1,24 @@ +package com.baeldung.maven.it; + +import org.junit.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.util.Scanner; + +import static org.junit.Assert.assertEquals; + +public class RestIntegrationTest { + @Test + public void whenSendingGet_thenMessageIsReturned() throws IOException { + String url = "http://localhost:8999"; + URLConnection connection = new URL(url).openConnection(); + try (InputStream response = connection.getInputStream(); + Scanner scanner = new Scanner(response)) { + String responseBody = scanner.nextLine(); + assertEquals("Welcome to Baeldung!", responseBody); + } + } +} diff --git a/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestJUnitTest.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestJUnitTest.java new file mode 100644 index 0000000000..60995d75bd --- /dev/null +++ b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/it/RestJUnitTest.java @@ -0,0 +1,26 @@ +package com.baeldung.maven.it; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.util.Scanner; + +import static org.junit.Assert.assertEquals; + +@Category(Integration.class) +public class RestJUnitTest { + @Test + public void whenSendingGet_thenMessageIsReturned() throws IOException { + String url = "http://localhost:8999"; + URLConnection connection = new URL(url).openConnection(); + try (InputStream response = connection.getInputStream(); + Scanner scanner = new Scanner(response)) { + String responseBody = scanner.nextLine(); + assertEquals("Welcome to Baeldung!", responseBody); + } + } +} diff --git a/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataCheck.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataCheck.java new file mode 100644 index 0000000000..9aaf0fb071 --- /dev/null +++ b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataCheck.java @@ -0,0 +1,15 @@ +package com.baeldung.maven.plugins; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; + +import com.baeldung.maven.plugins.Data; + +public class DataCheck { + @Test + public void whenDataObjectIsCreated_thenItIsNotNull() { + Data data = new Data(); + assertNotNull(data); + } +} diff --git a/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java new file mode 100644 index 0000000000..197f977fec --- /dev/null +++ b/maven-modules/maven-integration-test/src/test/java/com/baeldung/maven/plugins/DataUnitTest.java @@ -0,0 +1,15 @@ +package com.baeldung.maven.plugins; + +import static org.junit.Assert.assertNull; + +import org.junit.Test; + +import com.baeldung.maven.plugins.Data; + +public class DataUnitTest { + @Test + public void whenDataObjectIsNotCreated_thenItIsNull() { + Data data = null; + assertNull(data); + } +} diff --git a/maven-modules/maven-integration-test/src/test/java/testfail/TestFail.java b/maven-modules/maven-integration-test/src/test/java/testfail/TestFail.java new file mode 100644 index 0000000000..3febd21031 --- /dev/null +++ b/maven-modules/maven-integration-test/src/test/java/testfail/TestFail.java @@ -0,0 +1,18 @@ +package testfail; + +import org.junit.Test; +import org.junit.Ignore; + +import static org.junit.Assert.assertNotNull; + +public class TestFail { + + @Ignore //ignored so the entire tutorials build passes + @Test + public void whenMessageAssigned_thenItIsNotNull() { + String message = "hello there"; + message = null; + assertNotNull(message); + } + +} From e84dd497a51338b3467a58dc1a76bb50e304c30f Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 16:19:51 +0530 Subject: [PATCH 12/13] JAVA-49: new module for multiple source directories with Maven --- maven-modules/maven-multi-source/.gitignore | 2 + maven-modules/maven-multi-source/README.md | 7 ++ maven-modules/maven-multi-source/pom.xml | 92 +++++++++++++++++++ .../com/baeldung/maven/plugins/Foo.java | 10 ++ .../maven/plugins/MultipleSrcFolders.java | 9 ++ .../src/main/resources/logback.xml | 13 +++ 6 files changed, 133 insertions(+) create mode 100644 maven-modules/maven-multi-source/.gitignore create mode 100644 maven-modules/maven-multi-source/README.md create mode 100644 maven-modules/maven-multi-source/pom.xml create mode 100644 maven-modules/maven-multi-source/src/main/another-src/com/baeldung/maven/plugins/Foo.java create mode 100644 maven-modules/maven-multi-source/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java create mode 100644 maven-modules/maven-multi-source/src/main/resources/logback.xml diff --git a/maven-modules/maven-multi-source/.gitignore b/maven-modules/maven-multi-source/.gitignore new file mode 100644 index 0000000000..bae0b0d7ce --- /dev/null +++ b/maven-modules/maven-multi-source/.gitignore @@ -0,0 +1,2 @@ +/output-resources +/.idea/ diff --git a/maven-modules/maven-multi-source/README.md b/maven-modules/maven-multi-source/README.md new file mode 100644 index 0000000000..8298332c04 --- /dev/null +++ b/maven-modules/maven-multi-source/README.md @@ -0,0 +1,7 @@ +## Apache Maven - Multiple Source Directories + +This module contains articles about how to use multiple source directories with Maven. + +### Relevant Articles + +- [Maven Project with Multiple Source Directories](https://www.baeldung.com/maven-project-multiple-src-directories) \ No newline at end of file diff --git a/maven-modules/maven-multi-source/pom.xml b/maven-modules/maven-multi-source/pom.xml new file mode 100644 index 0000000000..0c85049df7 --- /dev/null +++ b/maven-modules/maven-multi-source/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + maven-multi-source + 0.0.1-SNAPSHOT + maven-multi-source + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../.. + + + + + + maven-compiler-plugin + ${maven.compiler.version} + + ${java.version} + ${java.version} + + -Xlint:unchecked + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${maven.build.helper.version} + + + generate-sources + + add-source + + + + src/main/another-src + + + + + + + + + + + surefire + + + + maven-surefire-plugin + ${maven.surefire.version} + + + integration-test + + test + + + + none + + + **/*IntegrationTest + + + + + + + + + + + + 3.0.2 + 3.8.0 + 2.22.0 + 2.22.0 + 1.1 + 3.0.0 + 3.0.0 + 9.4.11.v20180605 + 2.27 + + + \ No newline at end of file diff --git a/maven-modules/maven-multi-source/src/main/another-src/com/baeldung/maven/plugins/Foo.java b/maven-modules/maven-multi-source/src/main/another-src/com/baeldung/maven/plugins/Foo.java new file mode 100644 index 0000000000..f8a6fe9853 --- /dev/null +++ b/maven-modules/maven-multi-source/src/main/another-src/com/baeldung/maven/plugins/Foo.java @@ -0,0 +1,10 @@ +package com.baeldung.maven.plugins; + +public class Foo { + + public static String foo() { + return "foo"; + } + +} + diff --git a/maven-modules/maven-multi-source/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java b/maven-modules/maven-multi-source/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java new file mode 100644 index 0000000000..d403918dd3 --- /dev/null +++ b/maven-modules/maven-multi-source/src/main/java/com/baeldung/maven/plugins/MultipleSrcFolders.java @@ -0,0 +1,9 @@ +package com.baeldung.maven.plugins; + +public class MultipleSrcFolders { + + public static void callFoo() { + Foo.foo(); + } + +} diff --git a/maven-modules/maven-multi-source/src/main/resources/logback.xml b/maven-modules/maven-multi-source/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/maven-modules/maven-multi-source/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file From 405da9801f0ab27b8dc9263eba8609c4ad5e51b2 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 28 Jun 2020 16:20:50 +0530 Subject: [PATCH 13/13] JAVA-49: maven-all restructuring --- maven-modules/README.md | 9 +++++++++ maven-modules/pom.xml | 28 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 maven-modules/README.md create mode 100644 maven-modules/pom.xml diff --git a/maven-modules/README.md b/maven-modules/README.md new file mode 100644 index 0000000000..1ef664f879 --- /dev/null +++ b/maven-modules/README.md @@ -0,0 +1,9 @@ +## Apache Maven + +This module contains articles about Apache Maven. Please refer to its submodules. + +### Relevant Articles + +- [Apache Maven Tutorial](https://www.baeldung.com/maven) +- [Apache Maven Standard Directory Layout](https://www.baeldung.com/maven-directory-structure) +- [Multi-Module Project with Maven](https://www.baeldung.com/maven-multi-module) diff --git a/maven-modules/pom.xml b/maven-modules/pom.xml new file mode 100644 index 0000000000..56e0bd2bdc --- /dev/null +++ b/maven-modules/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + maven-modules + 0.0.1-SNAPSHOT + maven-modules + pom + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + maven-custom-plugin + maven-integration-test + maven-multi-source + maven-plugins + maven-unused-dependencies + maven-war-plugin + maven-profiles + versions-maven-plugin + + +