Hello all,

I'm having trouble with ivy files in cache. Ivy looks for an ivy file in
cache with the pattern "resolved-<organisation>-<module>-<revision>.xml"
when publishing.

Now, data from two projects, ProjectBar works, while ProjectFoo doesn't.

In the successful project (ProjectBar), publishing finds the file. Here is
the debug output:

        Overriding previous definition of property "ivy.revision"
        Setting project property: ivy.revision -> 1.0-dev-b4             //
Current version
        Setting project property: ivy.new.revision -> 1.0-dev-b5        //
New version
        Setting project property: ivy.build.number -> 4
        Setting project property: ivy.new.build.number -> 5
        version:
         [property] Loading
/home/deco/workspace/ProjectBar/build/classes/ProjectBar.properties
        Setting project property: version -> 1.0-dev-b5
        publish-no-test:
        [ivy:publish] parameter found as ivy variable:
ivy.organisation=info.projects
        [ivy:publish] parameter found as ivy variable: ivy.module=ProjectBar
        [ivy:publish] parameter found as ivy variable:
[EMAIL PROTECTED]        // Hey!! How is my host name as the old
revision???
        [ivy:publish] parameter found as attribute value:
ivy.deliver.revision=1.0-dev-b5
        [ivy:publish] parameter found as attribute value: ivy.status=release
        [ivy:publish] parameter found as attribute value:
ivy.organisation=info.projects
        [ivy:publish] parameter found as attribute value:
ivy.module=ProjectBar
        [ivy:publish] parameter found as attribute value:
[EMAIL PROTECTED]        // Really don't get it!
        [ivy:publish] parameter found as attribute value:
ivy.deliver.revision=1.0-dev-b5
        [ivy:publish] parameter found as attribute value:
ivy.deliver.ivy.pattern=/home/deco/workspace/ProjectBar/dist/[artifact].[ext]
        [ivy:publish] parameter found as attribute value: ivy.status=release
        [ivy:publish] parameter not found: ivy.delivery.list.file
           +Task: property
         [property] Loading /tmp/delivery.properties
         [property] Unable to find property file: /tmp/delivery.properties
        [ivy:publish] :: delivering ::
info.projects#ProjectBar;[EMAIL PROTECTED] :: 1.0-dev-b5 :: release :: Thu Sep
11 16:15:23 GMT 2008
        [ivy:publish]     options = status=release pubdate=Thu Sep 11
16:15:23 GMT 2008 validate=true resolveDynamicRevisions=true resolveId=null

        ...

Ok, really didn't quite understand, but actually works because all ivy files
with the 'resolved' prefix that are written to my cache, have as
revision my host name "[EMAIL PROTECTED]"; so ivy is able to find the file
"[EMAIL PROTECTED]".

In the second project (ProjectFoo) ivy doesn't find the file, here the debug
output:

        Overriding previous definition of property "ivy.revision"
        Setting project property: ivy.revision -> 1.0-alpha1            //
OK, current version
        Setting project property: ivy.new.revision -> 1.0-alpha2        //
New version, so far so good.
        Setting project property: ivy.build.number -> 1
        Setting project property: ivy.new.build.number -> 2
        version:
         [property] Loading
/home/deco/workspace/ProjectFoo/dist/ProjectFoo.properties
        Setting project property: version -> 1.0-alpha2
        publish:
             [echo] /home/deco/workspace/ProjectFoo/dist
        [ivy:publish] parameter found as ivy variable:
ivy.organisation=info.projects
        [ivy:publish] parameter found as ivy variable: ivy.module=ProjectFoo
        [ivy:publish] parameter found as ivy variable:
ivy.revision=1.0-alpha1            // Uau!!! Where is the 'trick' with the
Host Name
        [ivy:publish] parameter found as attribute value:
ivy.deliver.revision=1.0-alpha2
        [ivy:publish] parameter found as attribute value: ivy.status=release
        [ivy:publish] parameter found as attribute value:
ivy.organisation=info.projects
        [ivy:publish] parameter found as attribute value:
ivy.module=ProjectFoo
        [ivy:publish] parameter found as attribute value:
ivy.revision=1.0-alpha1        // actually found the right version.
        [ivy:publish] parameter found as attribute value:
ivy.deliver.revision=1.0-alpha2
        [ivy:publish] parameter found as attribute value:
ivy.deliver.ivy.pattern=/home/deco/workspace/ProjectFoo/dist/[artifact].[ext]
        [ivy:publish] parameter found as attribute value: ivy.status=release
        [ivy:publish] parameter not found: ivy.delivery.list.file
           +Task: property
         [property] Loading /tmp/delivery.properties
         [property] Unable to find property file: /tmp/delivery.properties
        [ivy:publish] :: delivering :: info.projects#ProjectFoo;1.0-alpha1
:: 1.0-alpha2 :: release :: Thu Sep 11 16:41:00 GMT 2008
        [ivy:publish]     options = status=release pubdate=Thu Sep 11
16:41:00 GMT 2008 validate=true resolveDynamicRevisions=true resolveId=null
          [antcall] Exiting /home/deco/workspace/ProjectFoo/build.xml.

        BUILD FAILED
        /home/deco/workspace/ProjectFoo/build.xml:51: The following error
occurred while executing this line:
        /home/deco/workspace/Release/release.xml:59: impossible to publish
artifacts for info.projects#ProjectFoo;1.0-alpha1:
info.projects#ProjectFoo;1.0-alpha1: java.lang.IllegalStateException: ivy
file not found in cache for info.projects#ProjectFoo;1.0-alpha1: please
resolve dependencies before delivering
(/home/deco/.ivy2/cache/resolved-info.projects-ProjectFoo-1.0-alpha1.xml)
            at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:541)
            at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
            at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
            at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
            at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
            at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.Target.execute(Target.java:357)
            at org.apache.tools.ant.Target.performTasks(Target.java:385)
            at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
            at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
            at
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
            at
org.apache.tools.ant.Project.executeTargets(Project.java:1181)
            at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
            at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
        Caused by: /home/deco/workspace/Release/release.xml:59: impossible
to publish artifacts for info.projects#ProjectFoo;1.0-alpha1:
    info.projects#ProjectFoo;1.0-alpha1:
            java.lang.IllegalStateException: ivy file not found in cache for
info.projects#ProjectFoo;1.0-alpha1: please resolve dependencies before
delivering (
/home/deco/.ivy2/cache/resolved-info.projects-ProjectFoo-1.0-alpha1.xml)

            // Unfortunately, the file in cache is '
[EMAIL PROTECTED]' and ivy is looking
for 'resolved-info.projects-ProjectFoo-1.0-alpha1.xml'.


Can anyone tell, what am I doing wrong, or if this is actually a bug?

Thanks,

Paulo


Below are the "version" and "publish" targets for both projects
==============================================================
======================    ProjectFoo    ===============================
==============================================================
    <target name="ivy-new-version" unless="ivy.new.revision">
        <!-- default module version prefix value -->
        <property name="module.version.prefix"
value="${marketing.version.target}-${version.classifier}" />

        <!-- asks to ivy an available version number -->
        <ivy:info file="${ivy.file}" />
        <ivy:buildnumber
            organisation="${ivy.organisation}" module="${ivy.module}"
            revision="${module.version.prefix}" defaultBuildNumber="1"
revSep=""/>
    </target>

    <target name="version" depends="ivy-new-version">
        <!-- create version file in classpath for later inclusion in jar -->
        <mkdir dir="${dist.root}"/>
        <echo  message="version=${ivy.new.revision}" file="${dist.root}/${
ant.project.name}.properties" append="false" />
        <!-- load generated version properties file -->
        <property file="${dist.root}/${ant.project.name}.properties" />
    </target>


    <target name="publish" depends="version" description="--> publish this
project in the shared repository">
        <ivy:publish artifactspattern="${dist.root}/[artifact].[ext]"
                           resolver="ivysvn"
                           pubrevision="${version}"
                           status="release"
                           forcedeliver="true"
        />
        <echo message="project ${ant.project.name} released with version
${version}" />
    </target>
==============================================================
======================    /ProjectFoo    ==============================
==============================================================

==============================================================
======================    ProjectBar   ===============================
==============================================================
    <target name="ivy-new-version" unless="ivy.new.revision">
        <!-- default module version prefix value -->
        <property name="module.version.prefix"
value="${module.version.target}-dev-b" />

        <!-- asks to ivy an available version number -->
        <ivy:info file="${ivy.file}" />
        <ivy:buildnumber
            organisation="${ivy.organisation}" module="${ivy.module}"
            revision="${module.version.prefix}" defaultBuildNumber="1"
revSep=""/>
    </target>

    <target name="version" depends="ivy-new-version">
        <!-- create version file in classpath for later inclusion in jar -->
        <!--   <mkdir dir="${build.classes}"/>-->
        <echo  message="version=${ivy.new.revision}"
file="${build.classes}/${ant.project.name}.properties" append="false" />
        <!-- load generated version properties file -->
        <property file="${build.classes}/${ant.project.name}.properties" />
    </target>

      <target name="publish-no-test" depends="jar, version" description="-->
publish this project in the shared repository">
            <ivy:publish artifactspattern="${dist.root}/[artifact].[ext]"
                               resolver="ivysvn"
                               pubrevision="${version}"
                               status="release"
            />
            <echo message="project ${ant.project.name} released with version
${version}" />
        </target>
==============================================================
======================    /ProjectBar    ==============================
==============================================================

Reply via email to