sat*_*sat 5 intellij-idea gradle maven-3 maven build.gradle
我有两个项目.一个Maven和一个Gradle.该公司还有一个内部maven存储库.我正在尝试设置Gradle以使用内部仓库.使用Intellij 13时,我将这样的repo添加到build.gradle中的Gradle
build.gradle文件:
apply plugin: 'java'
apply plugin: 'war'
sourceCompatibility = 1.5
version = '1.0'
maven {
url "http://nexus.company.com/nexus/repo"
}
mavenLocal()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
Run Code Online (Sandbox Code Playgroud)
.m2/settings.xml似乎被gradle完全忽略(我尝试不将maven repo添加到build.gradle文件中,并希望gradle将查看.m2/settings.xml以确定从哪里获取工件)
.m2/settings.xml文件
<settings>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://nexus.company.com/nexus/repo</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>central-repo</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>central-repo</activeProfile>
</activeProfiles>
</settings>
Run Code Online (Sandbox Code Playgroud)
当repo为http://nexus.company.com/nexus/repo时,Intellij会在后台任务中永远旋转,说"处理索引" .没有它,一切工作都很好,除了内部工件无法下载.
但是,maven项目需要相同的工件下载并在几秒钟内就绪.
我很陌生.我犯了什么错吗?