gradle 1.10 internal maven repository indexing forever in intellij 13

こ雲淡風輕ζ 提交于 2019-12-06 02:49:04

问题


I have two projects. One Maven and one Gradle. The company also has an internal maven repository. I am trying to setup Gradle to use the internal repo. Using Intellij 13, when I add the repo like so to Gradle in build.gradle

build.gradle file:

    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"
        }

The .m2/settings.xml seems to be ignored completely by gradle (I tried by not adding the maven repo to the build.gradle file and hoping that gradle will look at .m2/settings.xml to figure out where to fetch artifacts from)

.m2/settings.xml file

    <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>

Intellij spins forever in the background task saying "Processing indices" when the repo is http://nexus.company.com/nexus/repo is added. Without it things work just fine except the internal artifacts are not available for download.

However, the maven project requiring the same artifacts downloads and is ready in a few seconds.

I am very new to gradle. Did I make any mistake?


回答1:


For the "indexing forever", I was using a fresh IntelliJ install and ended up just having to wait 15 - 20m @100% CPU per index. On subsequent launches there was no problem.



来源:https://stackoverflow.com/questions/22339142/gradle-1-10-internal-maven-repository-indexing-forever-in-intellij-13

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!