我已经使用默认配置在我的本地主机上设置了一个Archiva实例。我尝试了几种不同的 Gradle 配置来解析档案实例,但似乎都没有。
- 使用 mavenRepo
- 行家
- 使用 Ivy 并仅指定工件模式(当我使用 Ivy 时有效)
构建.gradle
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
repositories {
mavenRepo url: 'http://localhost:8080/archiva', artifactUrls: [
'http://localhost:8080/archiva/repository/internal',
'http://localhost:8080/archiva/repository/snapshot'
]
maven { url 'http://localhost:8080/archiva' }
ivy {
artifactPattern 'http://localhost:8080/archiva/repository/internal/[organisation]/[artifact]/[revision]/[artifact](-[revision]).[ext]'
}
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.10'
}
}
dependsOnChildren()
我不认为发布任何/所有子项目 gradle 文件是相关的,但如果您认为有必要,我可以。
我在这里缺少什么吗?gradle 对 localhost url 的处理方式是否与非 localhost 不同(因为mavenCentral
正在解析依赖项)?我需要做什么才能让 Gradle 解析为 Maven 存储库的本地实例?
编辑: @Peter Niederwieser
:/> gradle build
> Loading > Resolving dependencies ':projects:project-plugin-framework:classpat
:projects:compileJava UP-TO-DATE
:projects:processResources UP-TO-DATE
:projects:classes UP-TO-DATE
:projects:jar UP-TO-DATE
:projects:assemble UP-TO-DATE
:projects:compileTestJava UP-TO-DATE
:projects:processTestResources UP-TO-DATE
:projects:testClasses UP-TO-DATE
:projects:test UP-TO-DATE
:projects:check UP-TO-DATE
:projects:build UP-TO-DATE
:projects:project-plugin-framework:compileJava UP-TO-DATE
:projects:project-plugin-framework:processResources UP-TO-DATE
:projects:project-plugin-framework:classes UP-TO-DATE
:projects:project-plugin-framework:jar UP-TO-DATE
:projects:project:compileJava UP-TO-DATE
:projects:project:processResources UP-TO-DATE
:projects:project:classes UP-TO-DATE
:projects:project:jar UP-TO-DATE
:projects:project:assemble UP-TO-DATE
:projects:project:compileTestJava UP-TO-DATE
:projects:project:processTestResources UP-TO-DATE
:projects:project:testClasses UP-TO-DATE
> Building > :projects:project:test > Resolving dependencies ':projects:mag
:projects:project:test
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':projects:project:tes
tRuntime'.
> Could not find group:jspf, module:jspf.core, version:1.0.2.
Required by:
Project.projects:project:0.0.1
Project.projects:project:0.0.1 > Project.projects:project-pl
ugin-framework:0.0.1
> Could not find any version that matches group:erichschroeter, module:applib, v
ersion:latest.integration.
Required by:
Project.projects:project:0.0.1
Project.projects:project:0.0.1 > Project.projects:project-pl
ugin-framework:0.0.1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 12.61 secs