不好的书告诉错误的概念,使无知者变得更无知。——菲尔丁

方法很简单,引入

1
2
3
4
5
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>${license-maven-plugin.version}</version>
</plugin>

版本是

1
<license-maven-plugin.version>2.4.0</license-maven-plugin.version>

然后使用:

1
mvn license:aggregate-add-third-party

然后就会输出:

1
[INFO] Writing third-party file to /Users/achao/IdeaProjects/stream-query/target/generated-sources/license/THIRD-PARTY.txt

打开一看:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Lists of 77 third-party dependencies.
(Eclipse Public License - v 1.0) (GNU Lesser General Public License) Logback Classic Module (ch.qos.logback:logback-classic:1.2.11 - http://logback.qos.ch/logback-classic)
(Eclipse Public License - v 1.0) (GNU Lesser General Public License) Logback Core Module (ch.qos.logback:logback-core:1.2.11 - http://logback.qos.ch/logback-core)
(Apache 2) TransmittableThreadLocal(TTL) (com.alibaba:transmittable-thread-local:2.14.5 - https://github.com/alibaba/transmittable-thread-local)
(The Apache License, Version 2.0) mybatis-plus (com.baomidou:mybatis-plus:3.5.5 - https://github.com/baomidou/mybatis-plus)
(The Apache License, Version 2.0) mybatis-plus (com.baomidou:mybatis-plus-annotation:3.5.5 - https://github.com/baomidou/mybatis-plus)
(The Apache License, Version 2.0) mybatis-plus (com.baomidou:mybatis-plus-boot-starter:3.5.5 - https://github.com/baomidou/mybatis-plus)
(The Apache License, Version 2.0) mybatis-plus (com.baomidou:mybatis-plus-boot-starter-test:3.5.5 - https://github.com/baomidou/mybatis-plus)
(The Apache License, Version 2.0) mybatis-plus (com.baomidou:mybatis-plus-core:3.5.5 - https://github.com/baomidou/mybatis-plus)
(The Apache License, Version 2.0) mybatis-plus (com.baomidou:mybatis-plus-extension:3.5.5 - https://github.com/baomidou/mybatis-plus)
(The Apache License, Version 2.0) mybatis-plus (com.baomidou:mybatis-plus-spring-boot-autoconfigure:3.5.5 - https://github.com/baomidou/mybatis-plus)
(The Apache License, Version 2.0) mybatis-plus (com.baomidou:mybatis-plus-spring-boot-test-autoconfigure:3.5.5 - https://github.com/baomidou/mybatis-plus)
(The Apache Software License, Version 2.0) Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.13.3 - http://github.com/FasterXML/jackson)
(The Apache Software License, Version 2.0) Jackson-core (com.fasterxml.jackson.core:jackson-core:2.13.3 - https://github.com/FasterXML/jackson-core)
(The Apache Software License, Version 2.0) jackson-databind (com.fasterxml.jackson.core:jackson-databind:2.13.3 - http://github.com/FasterXML/jackson)
(The Apache Software License, Version 2.0) Jackson datatype: jdk8 (com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.3 - https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jdk8)
(The Apache Software License, Version 2.0) Jackson datatype: JSR310 (com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.3 - https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310)
(The Apache Software License, Version 2.0) Jackson-module-parameter-names (com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.3 - https://github.com/FasterXML/jackson-modules-java8/jackson-module-parameter-names)
(GNU Library or Lesser General Public License (LGPL) V2.1) (The Apache Software License, Version 2.0) JSQLParser library (com.github.jsqlparser:jsqlparser:4.6 - https://github.com/JSQLParser/JSqlParser)
(BSD-3-Clause) Protocol Buffers [Core] (com.google.protobuf:protobuf-java:3.21.9 - https://developers.google.com/protocol-buffers/protobuf-java/)
(EPL 1.0) (MPL 2.0) H2 Database Engine (com.h2database:h2:2.2.224 - https://h2database.com)
(The Apache Software License, Version 2.0) project ':json-path' (com.jayway.jsonpath:json-path:2.7.0 - https://github.com/jayway/JsonPath)
(The GNU General Public License, v2 with Universal FOSS Exception, v1.0) MySQL Connector/J (com.mysql:mysql-connector-j:8.0.33 - http://dev.mysql.com/doc/connector-j/en/)
(Apache License 2.0) JSON library from Android SDK (com.vaadin.external.google:android-json:0.0.20131108.vaadin1 - http://developer.android.com/sdk)
(The Apache Software License, Version 2.0) HikariCP (com.zaxxer:HikariCP:4.0.3 - https://github.com/brettwooldridge/HikariCP)
(EDL 1.0) Jakarta Activation API jar (jakarta.activation:jakarta.activation-api:1.2.2 - https://github.com/eclipse-ee4j/jaf/jakarta.activation-api)
(EPL 2.0) (GPL2 w/ CPE) Jakarta Annotations API (jakarta.annotation:jakarta.annotation-api:1.3.5 - https://projects.eclipse.org/projects/ee4j.ca)
(Eclipse Distribution License - v 1.0) Jakarta XML Binding API (jakarta.xml.bind:jakarta.xml.bind-api:2.3.3 - https://github.com/eclipse-ee4j/jaxb-api/jakarta.xml.bind-api)
(Apache License, Version 2.0) Byte Buddy (without dependencies) (net.bytebuddy:byte-buddy:1.14.12 - https://bytebuddy.net/byte-buddy)
(Apache License, Version 2.0) Byte Buddy agent (net.bytebuddy:byte-buddy-agent:1.12.9 - https://bytebuddy.net/byte-buddy-agent)
(The Apache Software License, Version 2.0) ASM based accessors helper used by json-smart (net.minidev:accessors-smart:2.4.7 - https://urielch.github.io/)
(The Apache Software License, Version 2.0) JSON Small and Fast Parser (net.minidev:json-smart:2.4.7 - https://urielch.github.io/)
(Apache License, Version 2.0) Apache Log4j API (org.apache.logging.log4j:log4j-api:2.17.2 - https://logging.apache.org/log4j/2.x/log4j-api/)
(Apache License, Version 2.0) Apache Log4j to SLF4J Adapter (org.apache.logging.log4j:log4j-to-slf4j:2.17.2 - https://logging.apache.org/log4j/2.x/log4j-to-slf4j/)
(The Apache License, Version 2.0) org.apiguardian:apiguardian-api (org.apiguardian:apiguardian-api:1.1.2 - https://github.com/apiguardian-team/apiguardian)
(Apache License, Version 2.0) AssertJ fluent assertions (org.assertj:assertj-core:3.22.0 - https://assertj.github.io/doc/assertj-core/)
(The MIT License) Checker Qual (org.checkerframework:checker-qual:3.42.0 - https://checkerframework.org/)
(Apache Software License, Version 2.0) Stream Core (org.dromara.stream-query:stream-core:2.1.0 - https://github.com/dromara/stream-query/stream-parent/stream-core)
(BSD License 3) Hamcrest (org.hamcrest:hamcrest:2.2 - http://hamcrest.org/JavaHamcrest/)
(Eclipse Public License v2.0) JUnit Jupiter (Aggregator) (org.junit.jupiter:junit-jupiter:5.10.2 - https://junit.org/junit5/)
(Eclipse Public License v2.0) JUnit Jupiter API (org.junit.jupiter:junit-jupiter-api:5.10.2 - https://junit.org/junit5/)
(Eclipse Public License v2.0) JUnit Jupiter Engine (org.junit.jupiter:junit-jupiter-engine:5.10.2 - https://junit.org/junit5/)
(Eclipse Public License v2.0) JUnit Jupiter Params (org.junit.jupiter:junit-jupiter-params:5.10.2 - https://junit.org/junit5/)
(Eclipse Public License v2.0) JUnit Platform Commons (org.junit.platform:junit-platform-commons:1.10.2 - https://junit.org/junit5/)
(Eclipse Public License v2.0) JUnit Platform Engine API (org.junit.platform:junit-platform-engine:1.10.2 - https://junit.org/junit5/)
(The MIT License) mockito-core (org.mockito:mockito-core:4.5.1 - https://github.com/mockito/mockito)
(The MIT License) mockito-junit-jupiter (org.mockito:mockito-junit-jupiter:4.5.1 - https://github.com/mockito/mockito)
(The Apache Software License, Version 2.0) mybatis (org.mybatis:mybatis:3.5.15 - https://www.mybatis.org/mybatis-3)
(The Apache Software License, Version 2.0) mybatis-spring (org.mybatis:mybatis-spring:2.1.2 - http://www.mybatis.org/spring/)
(Apache License, Version 2.0) Objenesis (org.objenesis:objenesis:3.2 - http://objenesis.org/objenesis)
(The Apache License, Version 2.0) org.opentest4j:opentest4j (org.opentest4j:opentest4j:1.3.0 - https://github.com/ota4j-team/opentest4j)
(BSD-3-Clause) asm (org.ow2.asm:asm:9.1 - http://asm.ow2.io/)
(BSD-2-Clause) PostgreSQL JDBC Driver (org.postgresql:postgresql:42.7.3 - https://jdbc.postgresql.org)
(The MIT License) Project Lombok (org.projectlombok:lombok:1.18.30 - https://projectlombok.org)
(The Apache Software License, Version 2.0) JSONassert (org.skyscreamer:jsonassert:1.5.1 - https://github.com/skyscreamer/JSONassert)
(MIT License) JUL to SLF4J bridge (org.slf4j:jul-to-slf4j:1.7.36 - http://www.slf4j.org)
(MIT License) SLF4J API Module (org.slf4j:slf4j-api:1.7.30 - http://www.slf4j.org)
(Apache License, Version 2.0) Spring AOP (org.springframework:spring-aop:5.3.29 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) Spring Beans (org.springframework:spring-beans:5.3.29 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) Spring Context (org.springframework:spring-context:5.3.29 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) Spring Core (org.springframework:spring-core:5.3.29 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) Spring Expression Language (SpEL) (org.springframework:spring-expression:5.3.29 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) Spring Commons Logging Bridge (org.springframework:spring-jcl:5.3.29 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) Spring JDBC (org.springframework:spring-jdbc:5.3.29 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) Spring TestContext Framework (org.springframework:spring-test:5.3.29 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) Spring Transaction (org.springframework:spring-tx:5.3.29 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) Spring Web (org.springframework:spring-web:5.3.20 - https://github.com/spring-projects/spring-framework)
(Apache License, Version 2.0) spring-boot (org.springframework.boot:spring-boot:2.7.15 - https://spring.io/projects/spring-boot)
(Apache License, Version 2.0) spring-boot-autoconfigure (org.springframework.boot:spring-boot-autoconfigure:2.7.15 - https://spring.io/projects/spring-boot)
(Apache License, Version 2.0) spring-boot-starter (org.springframework.boot:spring-boot-starter:2.7.0 - https://spring.io/projects/spring-boot)
(Apache License, Version 2.0) spring-boot-starter-jdbc (org.springframework.boot:spring-boot-starter-jdbc:2.7.15 - https://spring.io/projects/spring-boot)
(Apache License, Version 2.0) spring-boot-starter-json (org.springframework.boot:spring-boot-starter-json:2.7.0 - https://spring.io/projects/spring-boot)
(Apache License, Version 2.0) spring-boot-starter-logging (org.springframework.boot:spring-boot-starter-logging:2.7.0 - https://spring.io/projects/spring-boot)
(Apache License, Version 2.0) spring-boot-starter-test (org.springframework.boot:spring-boot-starter-test:2.7.15 - https://spring.io/projects/spring-boot)
(Apache License, Version 2.0) spring-boot-test (org.springframework.boot:spring-boot-test:2.7.15 - https://spring.io/projects/spring-boot)
(Apache License, Version 2.0) spring-boot-test-autoconfigure (org.springframework.boot:spring-boot-test-autoconfigure:2.7.15 - https://spring.io/projects/spring-boot)
(The Apache Software License, Version 2.0) org.xmlunit:xmlunit-core (org.xmlunit:xmlunit-core:2.9.1 - https://www.xmlunit.org/)
(Apache License, Version 2.0) SnakeYAML (org.yaml:snakeyaml:1.30 - https://bitbucket.org/snakeyaml/snakeyaml)