我有一个 Grails (2.2.3) 项目,我正在尝试在 CloudBees 上构建它。该项目使用第三方库,该库当前未托管在任何公共 maven 存储库中。因此,我需要将此库 jar 发布到 Jenkins 在 CLoudbees 上构建的可以访问的私有 maven 存储库。
我已经成功构建了第三方 jar 并将其发布到我计算机上的本地 maven 存储库。
根据http://wiki.cloudbees.com/bin/view/DEV/CloudBees+Private+Maven+Repository上的指示,我已将第三方 jar 发布到我的 cloudbees 版本和快照存储库中。
但是,这对于 Cloudbees Jenkins 构建来获取单个 jar 是不够的。
我知道我的构建设置中的其他一切都很好,因为如果我将第三方 jar 添加到我的 grails 应用程序的 /lib/ 文件夹中,构建就会通过,但是将依赖项添加到 /lib/ 文件夹不是一个好习惯,所以我想避免它。
这是我在尝试构建时看到的错误:
| Loading Grails 2.2.3
| Configuring classpath
:: problems summary ::
:::: WARNINGS
module not found: com.singly#singly-sdk;1.0.0-SNAPSHOT
==== grailsPlugins: tried
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
/scratch/jenkins/workspace/foobarapp master/foobarapp/lib/singly-sdk-1.0.0-SNAPSHOT.jar
/home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/cache-1.0.0/lib/singly-sdk-1.0.0-SNAPSHOT.jar
/home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/hibernate-2.2.3/lib/singly-sdk-1.0.0-SNAPSHOT.jar
/home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/webxml-1.4.1/lib/singly-sdk-1.0.0-SNAPSHOT.jar
/home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/jquery-1.8.0/lib/singly-sdk-1.0.0-SNAPSHOT.jar
/home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/tomcat-2.2.3/lib/singly-sdk-1.0.0-SNAPSHOT.jar
/home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/database-migration-1.1/lib/singly-sdk-1.0.0-SNAPSHOT.jar
/home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/resources-1.1.6/lib/singly-sdk-1.0.0-SNAPSHOT.jar
/home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/rest-0.7/lib/singly-sdk-1.0.0-SNAPSHOT.jar
==== grailsHome: tried
/home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/lib/com.singly/singly-sdk/ivy-1.0.0-SNAPSHOT.xml
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
/home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/lib/com.singly/singly-sdk/jars/singly-sdk-1.0.0-SNAPSHOT.jar
/home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/lib/com.singly/singly-sdk/bundles/singly-sdk-1.0.0-SNAPSHOT.jar
==== grailsHome: tried
/home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/src/libs/singly-sdk-1.0.0-SNAPSHOT.xml
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
/home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/src/libs/singly-sdk-1.0.0-SNAPSHOT.jar
==== grailsHome: tried
/home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/dist/singly-sdk-1.0.0-SNAPSHOT.xml
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
/home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/dist/singly-sdk-1.0.0-SNAPSHOT.jar
==== grailsHome: tried
/home/jenkins/.grails/2.2.3/cached-installed-plugins/singly-sdk-1.0.0-SNAPSHOT.xml
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
/home/jenkins/.grails/2.2.3/cached-installed-plugins/singly-sdk-1.0.0-SNAPSHOT.jar
==== grailsHome: tried
/home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/plugins/singly-sdk-1.0.0-SNAPSHOT.pom
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
/home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/plugins/singly-sdk-1.0.0-SNAPSHOT.jar
==== grailsCentral: tried
http://grails.org/plugins/grails-singly-sdk/tags/RELEASE_1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.pom
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
http://grails.org/plugins/grails-singly-sdk/tags/RELEASE_1.0.0-SNAPSHOT/grails-singly-sdk-1.0.0-SNAPSHOT.jar
==== localMavenResolver: tried
/home/jenkins/.m2/repository/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.pom
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
/home/jenkins/.m2/repository/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.jar
==== mavenCentral: tried
http://repo1.maven.org/maven2/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.pom
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
http://repo1.maven.org/maven2/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.jar
==== localMavenResolver: tried
/home/jenkins/.m2/repository/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.pom
-- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
/home/jenkins/.m2/repository/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: com.singly#singly-sdk;1.0.0-SNAPSHOT: not found
::::::::::::::::::::::::::::::::::::::::::::::
本质上,Jenkins 并不知道它还必须查看 Cloudbees 快照或发布存储库。
本文档:http ://wiki.cloudbees.com/bin/view/DEV/Sharing+Files+with+Build+Executors 说您可以配置 CloudBees Jenkins 构建以使用您选择的 maven settings.xml 文件,但是CloudBees grails Jeknins 构建似乎没有提供设置自定义 maven settings.xml 的方法
我需要做什么才能让 Cloudbees Grails Jenikns Build 从 cloudbees 快照或发布存储库中获取 jar?