เป็นเวลานานแล้วที่ฉันมีรุ่น Jenkins ซึ่งดำเนินการ Sonar เป็นการดำเนินการหลังการสร้าง มันทำงานได้ดีมาหลายปีแล้ว แต่สัปดาห์ที่แล้วก็เริ่มล้มเหลวด้วยสิ่งนี้:
Downloading: http://myNexusServer/nexus/content/groups/public/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT/sonar-maven-plugin-2.2-SNAPSHOT.pom
Downloading: http://myNexusServer/nexus/content/groups/public/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT/sonar-maven-plugin-2.2-SNAPSHOT.jar
[INFO] Unable to find resource 'org.codehaus.mojo:sonar-maven-plugin:maven-plugin:2.2-SNAPSHOT' in repository central (http://central)
[INFO] Cannot find mojo descriptor for: 'sonar:sonar' - Treating as non-aggregator.
[INFO] ------------------------------------------------------------------------
[INFO] Building portal
[INFO] task-segment: [sonar:sonar]
[INFO] ------------------------------------------------------------------------
Downloading: http://myNexusServer/nexus/content/groups/public/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT/sonar-maven-plugin-2.2-SNAPSHOT.jar
[INFO] Unable to find resource 'org.codehaus.mojo:sonar-maven-plugin:maven-plugin:2.2-SNAPSHOT' in repository central (http://central)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository
...
ฉันมีสิ่งที่ฉันคิดว่าเป็นการตั้งค่ามาตรฐานที่ค่อนข้างดี โดยมี repo สาธารณะบน Nexus ของเราที่แชร์เนื้อหาทั้งหมดของ repos อื่น ๆ ใน Nexus เช่น repo OOTB Codehaus Snapshots (ใช่ ฉันได้ตรวจสอบสี่เท่าแล้วว่า repo Codehaus Snapshots อยู่ใน Ordered Group Repositories ของ repo สาธารณะ)
ฉันไม่เข้าใจวิธีการทำงานของสแน็ปช็อตอย่างสมบูรณ์ แต่ฉันรู้สึกว่าไฟล์ maven-metadata.xml แจ้งให้ลูกค้าทราบว่าสแน็ปช็อตเวอร์ชันใดพร้อมให้ดาวน์โหลด
หากฉันใช้เบราว์เซอร์และไปที่ repo codehaus-snapshots โดยตรง ฉันจะได้รับ maven-metadata.xml พร้อมข้อมูลเวอร์ชัน:
http://myNexusServer/nexus/service/local/repositories/codehaus-snapshots/content/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT/maven-metadata.xml
<metadata modelVersion="1.1.0">
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.2-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20131108.154049</timestamp>
<buildNumber>1</buildNumber>
</snapshot>
<lastUpdated>20131108154049</lastUpdated>
<snapshotVersions>
<snapshotVersion>
<extension>jar</extension>
<value>2.2-20131108.154049-1</value>
<updated>20131108154049</updated>
</snapshotVersion>
<snapshotVersion>
<extension>pom</extension>
<value>2.2-20131108.154049-1</value>
<updated>20131108154049</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>
</metadata>
หากฉันพยายามโหลดจาก repo สาธารณะ มันไม่พบ:
http://myNexusServer/nexus/content/groups/public/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT/maven-metadata.xml
The server has not found anything matching the request URI
ถ้าฉันเพิ่ม ?อธิบาย ลงในคำขอไปยัง repo สาธารณะ ฉันจะได้รับ:
{ "data" : { "processingTimeMillis" : 108,
"request" : { "requestContext" : [ "request.received.timestamp=1384808412437",
"request.address=my.ip.addy",
"request.remoteOnly=false",
"request.url=http://myNexusServer/nexus/content/groups/public/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT/maven-metadata.xml?describe",
"request.localOnly=false",
"request.appRootUrl=http://myNexusServer/nexus"
],
"requestPath" : "/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT/maven-metadata.xml",
"requestUrl" : "http://myNexusServer/nexus/content/groups/public/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT/maven-metadata.xml?describe"
},
"requestUrl" : "http://myNexusServer/nexus/content/groups/public/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT/maven-metadata.xml?describe",
"response" : { "appliedMappings" : [ "public repository applied []" ],
"processedRepositoriesList" : [ "public",
"releases",
"snapshots",
"thirdparty",
"central",
"java.net-m2",
"java.net-m1-m2",
"google",
"apache-snapshots",
"codehaus-snapshots",
"sonatype.public",
"com.springsource.repository.bundles.release",
"sonar.repo",
"com.springsource.repository.bundles.external"
],
"responseType" : "NOT_FOUND"
}
}
}
เมื่อฉันพยายามสร้าง sonar:sonar ฉันได้รับ maven-metadata-central.xml ใน .m2/repository/org/codehaus/mojo/sonar-maven-plugin/2.2-SNAPSHOT แต่ไม่มีข้อมูลเวอร์ชัน:
<metadata>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.2-SNAPSHOT</version>
</metadata>
ดังนั้นฉันคิดว่าปัญหาคือ repo สาธารณะไม่ได้ให้ข้อมูลเวอร์ชัน maven-metadata.xml แก่ไคลเอนต์ ดังนั้นไคลเอนต์จึงพยายามดาวน์โหลดโดยไม่มีข้อมูลเวอร์ชัน และล้มเหลวเมื่อหาไม่พบ ฉันพูดถูกหรือเปล่า?
ฉันต้องเปลี่ยนแปลงอะไรบ้างเกี่ยวกับการกำหนดค่า Nexus ของฉัน (หรืออาจเป็นเจนกินส์) เพื่อให้ทำงานได้อีกครั้ง