使用Spotify Maven插件将Docker推送到Docker Hub

时间:2019-04-16 18:11:30

标签: maven spring-boot docker

我正在尝试将简单的springboot docker映像推送到私有docker hub存储库,但出现错误。我正在使用 spring-boot-maven-plugin 来执行此操作,并且我希望在运行 mvn deploy

时推送映像
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project app: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
[ERROR] 

如何才能在pom中设置存储库参数才能工作?

我的pom:

 <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>dockerfile-maven-plugin</artifactId>
                <configuration>

                    <repository>my_username/project_name</repository>
                    <tag>${project.version}</tag>
                </configuration>
                <executions>
                    <execution>
                        <id>default</id>
                        <goals>
                            <goal>build</goal>
                            <goal>push</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

0 个答案:

没有答案