这是我的 pom.xml:
<groupId>com.securebort.services</groupId>
<artifactId>services</artifactId>
<version>0.0.2</version>
<packaging>jar</packaging>
<name>services</name>
<description>Cipherworks services exposed to the client applications</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
<beanstalk.versionLabel>${maven.build.timestamp}</beanstalk.versionLabel>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>9.0.1</version>
</dependency>
<dependency>
<groupId>com.cipherworks</groupId>
<artifactId>cwcommon</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>securebort</groupId>
<artifactId>datacrypt</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.cwkit</groupId>
<artifactId>cwkit</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.cipherworks</groupId>
<artifactId>iam</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.0.4.RELEASE</version>
<configuration>
<layout>JAR</layout>
<mainClass>com.cipherworks.services.ServicesApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
当我做 mvn package 时,它会创建一个重新打包的 jar 文件。但是重新打包的 jar 不包含我的依赖项 cwcommon、datacrypt 和 cwkit jar。我检查了我的本地存储库,它有我所有的依赖 jar 文件。出于某种原因,它们没有被重新包装到胖罐中。
目标依赖项的输出:树:由于堆栈溢出的大小限制,我无法复制和粘贴所有输出。我只复制了具有我的依赖项的部分。
....
....
....
[DEBUG] Using local repository at C:\Users\CipherWorks\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:\Users\CipherWorks\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.securebort.services:services:jar:0.0.2: (none)
[DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
[DEBUG] Extension realms for project org.springframework.boot:spring-boot-starter-parent:pom:2.0.4.RELEASE: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Extension realms for project org.springframework.boot:spring-boot-dependencies:pom:2.0.4.RELEASE: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Resolving plugin prefix dependency from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix dependency to org.apache.maven.plugins:maven-dependency-plugin from POM com.securebort.services:services:jar:0.0.2
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.securebort.services:services:jar:0.0.2
[DEBUG] Tasks: [dependency:tree]
[DEBUG] Style: Regular
[DEBUG] =======================================================================
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building services 0.0.2
....
....
....
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project: com.securebort.services:services:0.0.2
....
....
[DEBUG] org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.32:provided
[DEBUG] org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.32:provided
[DEBUG] org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.32:provided
[DEBUG] org.apache.tomcat:tomcat-jdbc:jar:9.0.1:compile
[DEBUG] org.apache.tomcat:tomcat-juli:jar:9.0.1:compile
[DEBUG] com.cipherworks:cwcommon:jar:0.0.1:compile
[DEBUG] securebort:datacrypt:jar:0.0.1:compile
[DEBUG] com.cwkit:cwkit:jar:0.0.1:compile
[DEBUG] com.google.code.gson:gson:jar:2.8.5:compile (version managed from 2.6.2 by org.springframework.boot:spring-boot-dependencies:2.0.4.RELEASE)
[DEBUG] org.slf4j:slf4j-api:jar:1.7.25:compile (version managed from 1.7.24 by org.springframework.boot:spring-boot-dependencies:2.0.4.RELEASE)
[DEBUG] com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.9.6:compile (version managed from 2.9.5 by com.fasterxml.jackson:jackson-bom:2.9.6)
[DEBUG] com.fasterxml.jackson.core:jackson-core:jar:2.9.6:compile
....
....
[DEBUG] org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[DEBUG] com.fasterxml.woodstox:woodstox-core:jar:5.0.3:compile
[DEBUG] com.cipherworks:iam:jar:0.0.1:compile
[DEBUG] com.amazonaws:aws-java-sdk:jar:1.11.396:compile
[DEBUG] com.amazonaws:aws-java-sdk-dlm:jar:1.11.396:compile
.....
.....
[DEBUG] (f) outputType = text
[DEBUG] (f) project = MavenProject: com.securebort.services:services:0.0.2 @ C:\git\services\pom.xml
[DEBUG] (f) reactorProjects = [MavenProject: com.securebort.services:services:0.0.2 @ C:\git\services\pom.xml]
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@3872bc37
...
...
[DEBUG] org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.32:provided
[DEBUG] org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.32:provided
[DEBUG] org.apache.tomcat:tomcat-jdbc:jar:9.0.1:compile
[DEBUG] org.apache.tomcat:tomcat-juli:jar:9.0.1:compile
[DEBUG] com.cipherworks:cwcommon:jar:0.0.1:compile
[DEBUG] securebort:datacrypt:jar:0.0.1:compile
[DEBUG] com.cwkit:cwkit:jar:0.0.1:compile
[DEBUG] com.google.code.gson:gson:jar:2.8.5:compile (version managed from 2.6.2 by org.springframework.boot:spring-boot-dependencies:2.0.4.RELEASE)
...
...
[DEBUG] com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.9.6:compile
[DEBUG] org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[DEBUG] com.fasterxml.woodstox:woodstox-core:jar:5.0.3:compile
[DEBUG] com.cipherworks:iam:jar:0.0.1:compile
[DEBUG] com.amazonaws:aws-java-sdk:jar:1.11.396:compile
[DEBUG] com.amazonaws:aws-java-sdk-dlm:jar:1.11.396:compile
...
...
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.32:provided
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.32:provided
[INFO] +- org.apache.tomcat:tomcat-jdbc:jar:9.0.1:compile
[INFO] | \- org.apache.tomcat:tomcat-juli:jar:9.0.1:compile
[INFO] +- com.cipherworks:cwcommon:jar:0.0.1:compile
[INFO] +- securebort:datacrypt:jar:0.0.1:compile
[INFO] +- com.cwkit:cwkit:jar:0.0.1:compile
[INFO] | +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.25:compile
...
...
我的依赖项(cwkit、cwcommon、datacrypt、iam)显示在 INFO 输出中。但它们并没有被包含在脂肪罐中。