我的父模块构建良好,但父项目中 /lib 文件夹中的 jar 没有被复制到 .m2 目录。没有从提到的依赖生成 jar 文件“sqljdbc”;请参见下面的 parent.pom.xml 文件
<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>common</groupId>
<artifactId>common-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>common-parent</name>
<packaging>pom</packaging>
<description>It's a Parent Project for Child Projects</description>
<repositories>
<repository>
<id>in-project</id>
<name>In Project Repo</name>
<url>file://${project.basedir}/lib</url>
</repository>
</repositories>
<build>
<finalName>common-parent</finalName>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>microsoft</groupId>
<artifactId>sqljdbc</artifactId>
<version>4</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>../FirstChild</module>
</modules>
</project>
让我知道我是否缺少某些东西。此外,我正在关注 https://dzone.com/articles/maven-multi-module-project-with-versioning 生成模块