maven 无法安装plugin的问题


spring有一个入门例子,在docker里跑spring-boot程序

 下载后按照教程执行mvn package docker:build。并不能成功。会报错。

[ERROR] No plugin found for prefix 'docker' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the 
repositories [local (D:\xxxxxxx), nexus (http://repo2.maven.org/maven2/), skynet (http://maven2.mirrors.skynet.be/pub/maven2/)] -> [Help 1]

 

仔细发现,并不是仓库中没有提供而是这个插件不在白名单里面

            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
            </plugin>

我们需要在settings.xml里把这个group加上

<settings>
    <pluginGroups>
        <pluginGroup>com.spotify</pluginGroup>
    </pluginGroups>
</settings>

这样就能正常下载这个插件了。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM