依赖传递,依赖排除
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!--junit-->
|
||||
<dependency>
|
||||
@@ -24,4 +25,26 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<!-- 打包插件 -->
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.4.1</version>
|
||||
<configuration>
|
||||
<descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals><goal>single</goal></goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@@ -1,7 +1,10 @@
|
||||
package com.inmind;
|
||||
|
||||
//import org.slf4j.Logger;
|
||||
|
||||
public class Demo {
|
||||
public static void main(String[] args) {
|
||||
// Logger logger;
|
||||
System.out.println("hello maven");
|
||||
}
|
||||
}
|
||||
|
9
maven-project01/src/test/java/com/inmind/Demo.java
Normal file
9
maven-project01/src/test/java/com/inmind/Demo.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package com.inmind;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class Demo {
|
||||
public static void main(String[] args) {
|
||||
Logger logger;
|
||||
}
|
||||
}
|
18
maven-project01/src/test/java/com/inmind/DemoTest.java
Normal file
18
maven-project01/src/test/java/com/inmind/DemoTest.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.inmind;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class DemoTest {
|
||||
@Test
|
||||
public void test1(){
|
||||
System.out.println("这是测试代码1");
|
||||
}
|
||||
@Test
|
||||
public void test2(){
|
||||
System.out.println("这是测试代码2");
|
||||
}
|
||||
@Test
|
||||
public void test3(){
|
||||
System.out.println("这是测试代码3");
|
||||
}
|
||||
}
|
36
maven-projectA/pom.xml
Normal file
36
maven-projectA/pom.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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>
|
||||
|
||||
<groupId>com.inmind</groupId>
|
||||
<artifactId>maven-projectA</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.inmind</groupId>
|
||||
<artifactId>maven-projectB</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<!--排除依赖:解决依赖冲突-->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
30
maven-projectB/pom.xml
Normal file
30
maven-projectB/pom.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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>
|
||||
|
||||
<groupId>com.inmind</groupId>
|
||||
<artifactId>maven-projectB</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.inmind</groupId>
|
||||
<artifactId>maven-projectC</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.10</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
23
maven-projectC/pom.xml
Normal file
23
maven-projectC/pom.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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>
|
||||
|
||||
<groupId>com.inmind</groupId>
|
||||
<artifactId>maven-projectC</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
Reference in New Issue
Block a user