Getting Intellij IDEA jars using Ivy and TeamCity

Posted About 12 years ago. Visible to the public.

TeamCity can act as Ivy repository Show archive.org snapshot . IntelliJ IDEA Community Edition builds are therefore Ivy-enabled and publicly available Show archive.org snapshot , here's the corresponding ivy.xml Show archive.org snapshot .

"ivyconf.xml"

<ivysettings>
    <property name='ivy.checksums' value=''/>
    <caches defaultCache="${user.home}/.ivy/cache"/>
    <statuses>
        <status name='integration' integration='true'/>
    </statuses>
    <resolvers>
        <url name='idea-repo'   alwaysCheckExactRevision='yes' checkmodified='true'>
            <ivy      pattern='http://teamcity.jetbrains.com/guestAuth/repository/download/[module]/[revision]/teamcity-ivy.xml'/>
            <artifact pattern='http://teamcity.jetbrains.com/guestAuth/repository/download/[module]/[revision]/[artifact](.[ext])'/>
        </url>
    </resolvers>
    <modules>
        <module organisation='org' name='bt343' matcher='regexp' resolver='idea-repo'/>
    </modules>
</ivysettings>

"ivy.xml"

<ivy-module version="1.3">
    <info organisation="com.jetbrains" module="kotlin"/>
    <dependencies>
        <dependency org="org" name="bt343" rev="latest.lastSuccessful">
            <!-- http://teamcity.jetbrains.com/guestAuth/repository/download/bt343/latest.lastSuccessful/teamcity-ivy.xml -->
            <include name="core/.*" ext="jar" matcher="exactOrRegexp"/>
        </dependency>
    </dependencies>
</ivy-module>

"build.xml"

<project name="build-tools" default="buildIdeaClasspath" xmlns:ivy="antlib:org.apache.ivy.ant">
    <target name="buildIdeaClasspath" xmlns:ivy="antlib:org.apache.ivy.ant">
        
        <!-- Ivy jar + dependencies are copied to "ant/lib"                            -->
        <!-- http://apache.spd.co.il//ant/ivy/2.2.0/apache-ivy-2.2.0-bin-with-deps.zip -->
        <taskdef uri="antlib:org.apache.ivy.ant" resource="org/apache/ivy/ant/antlib.xml"/>

        <ivy:configure file="${basedir}/ivyconf.xml"/>
        <ivy:resolve   file="${basedir}/ivy.xml"/>
        <ivy:cachepath pathid="idea.classpath" organisation="org" revision="latest.lastSuccessful"/>
        <pathconvert refid="idea.classpath" property="idea.classpath.converted" pathsep="${line.separator}"/>
        <echo>${idea.classpath.converted}</echo>
    </target>
</project>

Putting it all together:

#[00:37:53][~/Temp]$ ant
Buildfile: /Users/evgenyg/Temp/build.xml

buildIdeaClasspath:
[ivy:configure] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file = /Users/evgenyg/Temp/ivyconf.xml
[ivy:resolve] :: resolving dependencies :: com.jetbrains#kotlin;working@Mac.local
[ivy:resolve]   confs: [default]
[ivy:resolve]   found org#bt343;12.lastSuccessful in idea-repo
[ivy:resolve]   [12.lastSuccessful] org#bt343;latest.lastSuccessful
[ivy:resolve] :: resolution report :: resolve 988ms :: artifacts dl 8ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      default     |   1   |   1   |   1   |   0   ||   8   |   0   |
    ---------------------------------------------------------------------
     [echo] /Users/evgenyg/.ivy2/cache/org/bt343/jars/core/annotations-12.lastSuccessful.jar
     [echo] /Users/evgenyg/.ivy2/cache/org/bt343/jars/core/intellij-core-12.lastSuccessful.jar
     [echo] /Users/evgenyg/.ivy2/cache/org/bt343/jars/core/asm-commons-12.lastSuccessful.jar
     [echo] /Users/evgenyg/.ivy2/cache/org/bt343/jars/core/asm-12.lastSuccessful.jar
     [echo] /Users/evgenyg/.ivy2/cache/org/bt343/jars/core/trove4j-12.lastSuccessful.jar
     [echo] /Users/evgenyg/.ivy2/cache/org/bt343/jars/core/cli-10-12.lastSuccessful.jar
     [echo] /Users/evgenyg/.ivy2/cache/org/bt343/jars/core/guava-r09-12.lastSuccessful.jar
     [echo] /Users/evgenyg/.ivy2/cache/org/bt343/jars/core/picocontainer-12.lastSuccessful.jar

BUILD SUCCESSFUL
Total time: 1 second
#[00:39:50][~/Temp]$ 
Evgeny Goldin
Last edit
About 12 years ago
Posted by Evgeny Goldin to Evgeny Goldin's deck (2012-01-29 21:48)