【发布时间】:2017-08-18 08:46:43
【问题描述】:
我有一个 grails 2.5.3 应用程序,它使用来自 maven 的插件和依赖项。现在我想使用公司内部的 Nexus 服务器设置作为我的应用程序使用的所有依赖项的代理。但是,我以前从未使用过 Nexus,所以我对事情的运作方式有点困惑。
我使用grails create-pom com.mycompany 为我的grails 应用程序生成了一个POM.xml。生成的pom有以下artifactId
<groupId>com.mycompany</groupId>
<artifactId>myproj</artifactId>
<packaging>grails-app</packaging>
<version>1.0.0.R1</version>
然后我将以下内容添加到POM.xml
<distributionManagement>
<repository>
<id>nexus</id>
<name>Nexus Repo</name>
<url>https://companynextus/content/repositories/myproj</url>
</repository>
</distributionManagement>
然后我运行mvn deploy
现在我可以在 https://companynextus/content/repositories/myproj/com/mycompany/myproj/1.0.0.R1/ 看到我的整个 WAR 文件和 POM
此时我只是将我的 BuildConfig.groovy 更改为:
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
}
收件人:
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
grailsRepo "https://companynextus/content/repositories/myproj/com/mycompany/myproj/1.0.0.R1"
mavenRepo "https://companynextus/content/repositories/myproj/com/mycompany/myproj/1.0.0.R1"
}
但我在执行grails prod war时出错
解决获取依赖项的错误:在 org.grails.plugins:tomcat:zip:8.0.33 中找不到工件 https://companynextus/content/repositories/myproj/com/mycompany/myproj/1.0.0.R1(https://companynextus/content/repositories/myproj/com/mycompany/myproj/1.0.0.R1) (使用 --stacktrace 查看完整的跟踪信息)
【问题讨论】:
-
这个问题的标题有点奇怪,技术上你还在使用 Maven,只是使用 Nexus 来代理或托管工件。
标签: maven grails nexus grails-plugin