JAVA-20381 Moved modules
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
## Relevant Articles
|
||||
- [Exclude a Dependency in a Maven Plugin](https://www.baeldung.com/mvn-plugin-dependency-exclusion)
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>core-java-exclusions</artifactId>
|
||||
<name>core-java-exclusions</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung.dependency-exclusion</groupId>
|
||||
<artifactId>dependency-exclusion</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${surefire-version}</version>
|
||||
<configuration>
|
||||
<runOrder>alphabetical</runOrder>
|
||||
<threadCount>1</threadCount>
|
||||
<properties>
|
||||
<property>
|
||||
<name>junit</name>
|
||||
<value>false</value>
|
||||
</property>
|
||||
</properties>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<!-- Deactivate JUnit 4.7 engine by overriding it with an empty dummy -->
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit47</artifactId>
|
||||
<version>dummy</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.sample.project.tests;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ExcludeDirectDependencyUnitTest {
|
||||
@Test
|
||||
public void basicUnitTest() {
|
||||
assertTrue(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit47</artifactId>
|
||||
<version>dummy</version>
|
||||
</project>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung.dependency-exclusion</groupId>
|
||||
<artifactId>dependency-exclusion</artifactId>
|
||||
<name>dependency-exclusion</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>maven-modules</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<surefire-version>2.22.2</surefire-version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>dummy-surefire-junit47</module>
|
||||
<module>core-java-exclusions</module>
|
||||
</modules>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${surefire-version}</version>
|
||||
<configuration>
|
||||
<threadCount>1</threadCount>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit-platform</artifactId>
|
||||
<version>${surefire-version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
+12
-10
@@ -16,33 +16,35 @@
|
||||
|
||||
<modules>
|
||||
<module>animal-sniffer-mvn-plugin</module>
|
||||
<module>maven-archetype</module>
|
||||
<module>compiler-plugin-java-9</module>
|
||||
<module>dependency-exclusion</module>
|
||||
<module>host-maven-repo-example</module>
|
||||
<module>maven-archetype</module>
|
||||
<module>maven-builder-plugin</module>
|
||||
<module>maven-classifier</module>
|
||||
<module>maven-copy-files</module>
|
||||
<module>maven-custom-plugin</module>
|
||||
<module>maven-exec-plugin</module>
|
||||
<module>maven-generate-war</module>
|
||||
<module>maven-integration-test</module>
|
||||
<module>maven-multi-source</module>
|
||||
<module>maven-parent-pom-resolution</module>
|
||||
<module>maven-plugins</module>
|
||||
<module>maven-polyglot</module>
|
||||
<module>maven-printing-plugins</module>
|
||||
<module>maven-properties</module>
|
||||
<!-- <module>maven-proxy</module> --> <!-- Not a maven project -->
|
||||
<module>maven-reactor</module>
|
||||
<module>maven-repositories</module>
|
||||
<module>maven-simple</module>
|
||||
<module>maven-surefire-plugin</module>
|
||||
<module>maven-unused-dependencies</module>
|
||||
<module>maven-war-plugin</module>
|
||||
<module>spring-bom</module>
|
||||
<module>optional-dependencies</module>
|
||||
<module>version-collision</module>
|
||||
<module>version-overriding-plugins</module>
|
||||
<module>versions-maven-plugin</module>
|
||||
<module>maven-printing-plugins</module>
|
||||
<module>maven-builder-plugin</module>
|
||||
<module>host-maven-repo-example</module>
|
||||
<module>maven-surefire-plugin</module>
|
||||
<module>maven-parent-pom-resolution</module>
|
||||
<module>maven-simple</module>
|
||||
<module>maven-classifier</module>
|
||||
<module>maven-repositories</module>
|
||||
<module>maven-reactor</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
## Spring BOM
|
||||
|
||||
This module contains articles about Spring with Maven BOM (Bill Of Materials)
|
||||
|
||||
### Relevant Articles:
|
||||
- [Spring with Maven BOM](https://www.baeldung.com/spring-maven-bom)
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>spring-bom</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<name>spring-bom</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>maven-modules</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-framework-bom</artifactId>
|
||||
<version>${spring-framework-bom.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<spring-framework-bom.version>4.3.8.RELEASE</spring-framework-bom.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.spring.bom;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
|
||||
public class HelloWorldApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ApplicationContext ctx = new AnnotationConfigApplicationContext(HelloWorldConfig.class);
|
||||
HelloWorldBean helloWorldBean = ctx.getBean(HelloWorldBean.class);
|
||||
System.out.println(helloWorldBean.sayHello());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.spring.bom;
|
||||
|
||||
public class HelloWorldBean {
|
||||
|
||||
public String sayHello() {
|
||||
return "Hello World With Maven BOM";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.baeldung.spring.bom;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class HelloWorldConfig {
|
||||
|
||||
@Bean
|
||||
public HelloWorldBean helloWorldBean() {
|
||||
return new HelloWorldBean();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.baeldung;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.baeldung.spring.bom.HelloWorldApp;
|
||||
|
||||
public class SpringContextTest {
|
||||
|
||||
@Test
|
||||
public final void testMain() throws Exception {
|
||||
HelloWorldApp.main(null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user