Home > Software engineering >  maven dose not download dependencies in pom.xml
maven dose not download dependencies in pom.xml

Time:09-17

my pom.xml file:

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.0</version>
        <relativePath/>
    </parent>
    <groupId>com.nocode</groupId>
    <artifactId>dataengine</artifactId>
    <version>0.0.2-SNAPSHOT</version>
    <name>dataengine</name>
    <description>Dataengine of nocode.</description>
    <packaging>pom</packaging>

    <properties>
        <dataengine-version>0.0.2-SNAPSHOT</dataengine-version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>16</maven.compiler.source>
        <maven.compiler.target>16</maven.compiler.target>
        <java.version>16</java.version>
        <mybatis-plus.version>3.4.0</mybatis-plus.version>
        <elasticsearch.version>7.4.0</elasticsearch.version>
        <hutool-all.version>5.7.9</hutool-all.version>
        <jackson.version>2.12.3</jackson.version>
        <spring-boot.version>2.5.0</spring-boot.version>
        <mybatis.version>3.5.7</mybatis.version>
        <hibernate-types.version>2.12.0</hibernate-types.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-amqp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt</artifactId>
            <version>0.9.1</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>org.javers</groupId>
            <artifactId>javers-core</artifactId>
            <version>6.2.5</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>springfox</artifactId>
            <version>2.1.3</version>
        </dependency>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>${mybatis-plus.version}</version>
        </dependency>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-generator</artifactId>
            <version>${mybatis-plus.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>${mybatis.version}</version>
        </dependency>
        <dependency>
            <groupId>com.vladmihalcea</groupId>
            <artifactId>hibernate-types-55</artifactId>
            <version>${hibernate-types.version}</version>
        </dependency>

        <!-- 模板引擎 -->
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-engine-core</artifactId>
            <version>2.2</version>
            <scope>test</scope>
        </dependency>

        <!-- util 工具包 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>4.4</version>
        </dependency>
        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
            <version>${hutool-all.version}</version>
        </dependency>

        <!-- 三方包 -->
        <dependency>
            <groupId>com.tencentcloudapi</groupId>
            <artifactId>tencentcloud-sdk-java</artifactId>
            <version>3.1.101</version>
        </dependency>
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-core</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-dm</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.vladsch.flexmark</groupId>
            <artifactId>flexmark-all</artifactId>
            <version>0.62.2</version>
        </dependency>
        <dependency>
            <groupId>com.belerweb</groupId>
            <artifactId>pinyin4j</artifactId>
            <version>2.5.1</version>
        </dependency>
        <dependency>
            <groupId>io.github.biezhi</groupId>
            <artifactId>TinyPinyin</artifactId>
            <version>2.0.3.RELEASE</version>
        </dependency>

        <!-- jackson -->
        <dependency>
            <groupId>com.fasterxml.commons.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <!-- spring 项目 -->
        <dependency>
            <groupId>org.springframework.shell</groupId>
            <artifactId>spring-shell-starter</artifactId>
            <version>2.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
            <version>3.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream</artifactId>
            <version>3.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.datatype</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.12.0</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.aliyun.oss</groupId>
            <artifactId>aliyun-sdk-oss</artifactId>
            <version>3.12.0</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>5.3.8</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.20</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-boot-starter</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.vesoft</groupId>
            <artifactId>client</artifactId>
            <version>2.5.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-log4j12</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>


    <repositories>
        <!--覆盖默认行为,避免插件重新走官方仓库导致速度慢 -->
        <repository>
            <id>central</id>
            <url>https://maven.aliyun.com/repository/central</url>
        </repository>
        <repository>
            <id>aliyun-releases</id>
            <name>aliyun-public</name>
            <url>https://maven.aliyun.com/repository/public</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <url>https://maven.aliyun.com/repository/public</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <finalName>${project.name}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

run mvn clean verify

the output log


[INFO] Scanning for projects...
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/springframework/boot/spring-boot-starter-parent/2.5.0/spring-boot-starter-parent-2.5.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/springframework/boot/spring-boot-starter-parent/2.5.0/spring-boot-starter-parent-2.5.0.pom (8.6 kB at 6.9 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/springframework/boot/spring-boot-dependencies/2.5.0/spring-boot-dependencies-2.5.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/springframework/boot/spring-boot-dependencies/2.5.0/spring-boot-dependencies-2.5.0.pom (109 kB at 203 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/com/datastax/oss/java-driver-bom/4.11.1/java-driver-bom-4.11.1.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/com/datastax/oss/java-driver-bom/4.11.1/java-driver-bom-4.11.1.pom (4.1 kB at 8.1 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/io/dropwizard/metrics/metrics-bom/4.1.21/metrics-bom-4.1.21.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/io/dropwizard/metrics/metrics-bom/4.1.21/metrics-bom-4.1.21.pom (5.3 kB at 10 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/io/dropwizard/metrics/metrics-parent/4.1.21/metrics-parent-4.1.21.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/io/dropwizard/metrics/metrics-parent/4.1.21/metrics-parent-4.1.21.pom (17 kB at 30 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/codehaus/groovy/groovy-bom/3.0.8/groovy-bom-3.0.8.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/codehaus/groovy/groovy-bom/3.0.8/groovy-bom-3.0.8.pom (26 kB at 53 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/infinispan/infinispan-bom/12.1.3.Final/infinispan-bom-12.1.3.Final.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/infinispan/infinispan-bom/12.1.3.Final/infinispan-bom-12.1.3.Final.pom (18 kB at 55 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/infinispan/infinispan-build-configuration-parent/12.1.3.Final/infinispan-build-configuration-parent-12.1.3.Final.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/infinispan/infinispan-build-configuration-parent/12.1.3.Final/infinispan-build-configuration-parent-12.1.3.Final.pom (13 kB at 22 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/jboss/jboss-parent/36/jboss-parent-36.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/jboss/jboss-parent/36/jboss-parent-36.pom (66 kB at 198 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/com/fasterxml/jackson/jackson-bom/2.12.3/jackson-bom-2.12.3.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/com/fasterxml/jackson/jackson-bom/2.12.3/jackson-bom-2.12.3.pom (17 kB at 43 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/com/fasterxml/jackson/jackson-parent/2.12/jackson-parent-2.12.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/com/fasterxml/jackson/jackson-parent/2.12/jackson-parent-2.12.pom (7.5 kB at 11 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/com/fasterxml/oss-parent/41/oss-parent-41.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/com/fasterxml/oss-parent/41/oss-parent-41.pom (23 kB at 99 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/glassfish/jersey/jersey-bom/2.33/jersey-bom-2.33.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/glassfish/jersey/jersey-bom/2.33/jersey-bom-2.33.pom (19 kB at 25 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/eclipse/ee4j/project/1.0.6/project-1.0.6.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/eclipse/ee4j/project/1.0.6/project-1.0.6.pom (13 kB at 39 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/eclipse/jetty/jetty-bom/9.4.41.v20210516/jetty-bom-9.4.41.v20210516.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/eclipse/jetty/jetty-bom/9.4.41.v20210516/jetty-bom-9.4.41.v20210516.pom (18 kB at 33 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/junit/junit-bom/5.7.2/junit-bom-5.7.2.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/junit/junit-bom/5.7.2/junit-bom-5.7.2.pom (5.1 kB at 14 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/jetbrains/kotlin/kotlin-bom/1.5.0/kotlin-bom-1.5.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/jetbrains/kotlin/kotlin-bom/1.5.0/kotlin-bom-1.5.0.pom (9.3 kB at 17 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/jetbrains/kotlinx/kotlinx-coroutines-bom/1.5.0/kotlinx-coroutines-bom-1.5.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/jetbrains/kotlinx/kotlinx-coroutines-bom/1.5.0/kotlinx-coroutines-bom-1.5.0.pom (4.1 kB at 11 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/apache/logging/log4j/log4j-bom/2.14.1/log4j-bom-2.14.1.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/apache/logging/log4j/log4j-bom/2.14.1/log4j-bom-2.14.1.pom (8.1 kB at 31 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/apache/logging/logging-parent/3/logging-parent-3.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/apache/logging/logging-parent/3/logging-parent-3.pom (3.1 kB at 6.6 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/apache/apache/23/apache-23.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/apache/apache/23/apache-23.pom (18 kB at 48 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/io/micrometer/micrometer-bom/1.7.0/micrometer-bom-1.7.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/io/micrometer/micrometer-bom/1.7.0/micrometer-bom-1.7.0.pom (6.8 kB at 13 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/io/netty/netty-bom/4.1.65.Final/netty-bom-4.1.65.Final.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/io/netty/netty-bom/4.1.65.Final/netty-bom-4.1.65.Final.pom (8.8 kB at 28 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/sonatype/oss/oss-parent/7/oss-parent-7.pom (4.8 kB at 6.9 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/com/oracle/database/jdbc/ojdbc-bom/21.1.0.0/ojdbc-bom-21.1.0.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/com/oracle/database/jdbc/ojdbc-bom/21.1.0.0/ojdbc-bom-21.1.0.0.pom (12 kB at 35 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/io/r2dbc/r2dbc-bom/Arabba-SR10/r2dbc-bom-Arabba-SR10.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/io/r2dbc/r2dbc-bom/Arabba-SR10/r2dbc-bom-Arabba-SR10.pom (4.3 kB at 20 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/io/projectreactor/reactor-bom/2020.0.7/reactor-bom-2020.0.7.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/io/projectreactor/reactor-bom/2020.0.7/reactor-bom-2020.0.7.pom (4.5 kB at 9.6 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/io/rsocket/rsocket-bom/1.1.0/rsocket-bom-1.1.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/io/rsocket/rsocket-bom/1.1.0/rsocket-bom-1.1.0.pom (2.6 kB at 7.2 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/springframework/data/spring-data-bom/2021.0.1/spring-data-bom-2021.0.1.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/springframework/data/spring-data-bom/2021.0.1/spring-data-bom-2021.0.1.pom (5.7 kB at 25 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/springframework/spring-framework-bom/5.3.7/spring-framework-bom-5.3.7.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/springframework/spring-framework-bom/5.3.7/spring-framework-bom-5.3.7.pom (5.6 kB at 17 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/springframework/integration/spring-integration-bom/5.5.0/spring-integration-bom-5.5.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/springframework/integration/spring-integration-bom/5.5.0/spring-integration-bom-5.5.0.pom (9.5 kB at 34 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/springframework/security/spring-security-bom/5.5.0/spring-security-bom-5.5.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/springframework/security/spring-security-bom/5.5.0/spring-security-bom-5.5.0.pom (5.7 kB at 23 kB/s)
[INFO] Downloading from central: https://maven.aliyun.com/repository/central/org/springframework/session/spring-session-bom/2021.0.0/spring-session-bom-2021.0.0.pom
[INFO] Downloaded from central: https://maven.aliyun.com/repository/central/org/springframework/session/spring-session-bom/2021.0.0/spring-session-bom-2021.0.0.pom (2.7 kB at 13 kB/s)
[INFO]
[INFO] -----------------------< com.nocode:dataengine >------------------------
[INFO] Building dataengine 0.0.2-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  15.428 s
[INFO] Finished at: 2021-09-15T03:19:45Z
[INFO] ------------------------------------------------------------------------

for example commons-lang3 not download

home .m2 cache

root@81b1bd3579fb:~# cd ~/.m2/
root@81b1bd3579fb:~/.m2# ls
copy_reference_file.log  repository  settings-docker.xml
root@81b1bd3579fb:~/.m2# find . -name "*.jar"

dockerfile

FROM maven:3.8.2-openjdk-11

WORKDIR /workspace

COPY pom_cache.xml pom.xml

RUN mvn verify -l install.log

CodePudding user response:

You have told Maven that your project is only a POM artifact (which doesn't have code or need jars):

<packaging>pom</packaging>

If you intend this to have Java code to be compiled, remove that tag.

  • Related