Dockerfile Maven 插件:找不到插件
Dockerfile Maven Plugin: Failure to find plugin
我想使用插件 "Dockerfile Maven" 从我的项目构建 docker 图像。当我将这个插件添加到我的 pom.xml
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-version}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>spotify/foobar</repository>
<tag>${project.version}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
我的 pom 的第一行出现错误:
Failure to find com.spotify:dockerfile-maven-plugin:jar:${dockerfile-maven-version} in https://
repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the
update interval of central has elapsed or updates are forced
我需要配置什么吗?我找不到有同样问题的人。这是我的 pom.xml 配置:
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>de.leuphana</groupId>
<artifactId>ArticleMicroService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ArticleMicroService</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<spring-cloud.version>Greenwich.SR1</spring-cloud.version>
</properties>
您在哪里定义变量的值dockerfile-maven-version
?
您应该将其添加到属性中
<properties>
<java.version>11</java.version>
<spring-cloud.version>Greenwich.SR1</spring-cloud.version>
<dockerfile-maven-version>1.4.10</dockerfile-maven-version>
</properties>
看来您需要在 POM 部分定义 dockerfile-maven-version
添加到属性:
<dockerfile-maven-version>1.4.10</dockerfile-maven-version>
我想使用插件 "Dockerfile Maven" 从我的项目构建 docker 图像。当我将这个插件添加到我的 pom.xml
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-version}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>spotify/foobar</repository>
<tag>${project.version}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
我的 pom 的第一行出现错误:
Failure to find com.spotify:dockerfile-maven-plugin:jar:${dockerfile-maven-version} in https://
repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the
update interval of central has elapsed or updates are forced
我需要配置什么吗?我找不到有同样问题的人。这是我的 pom.xml 配置:
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>de.leuphana</groupId>
<artifactId>ArticleMicroService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ArticleMicroService</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<spring-cloud.version>Greenwich.SR1</spring-cloud.version>
</properties>
您在哪里定义变量的值dockerfile-maven-version
?
您应该将其添加到属性中
<properties>
<java.version>11</java.version>
<spring-cloud.version>Greenwich.SR1</spring-cloud.version>
<dockerfile-maven-version>1.4.10</dockerfile-maven-version>
</properties>
看来您需要在 POM 部分定义 dockerfile-maven-version
添加到属性:
<dockerfile-maven-version>1.4.10</dockerfile-maven-version>