You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by "Brown, Carlton" <Ca...@compucredit.com> on 2008/04/04 19:52:10 UTC

Namespace problems

I'm getting errors I don't understand while using install with namespace
and I'd appreciate any insight.   
 
Briefly, my intention is to copy foo-module-1.0.0.0 from an RC
repository into a final repository with the version changed to 1.0.0
(truncating the final number).
 
My rename rule looks like this:

<rule>
     <fromsystem>
        <!-- Space holder, because although there will never be a
fromsystem copy, Ivy still throws NPE if we don't include this xml
element -->
     </fromsystem>
        <tosystem>
           <src rev="(.+)\.(.+)\.(.+)\.(.+)"/>
           
           <dest rev="$r1\.$r2\.$r3"/>
 
        </tosystem>
</rule>
 
First, a question... clearly, the <fromsystem> is required because I get
a NullPointerException if it is not defined.  But am I wrong to think
that <fromsystem> is unnecessary if I know that I will never install
*from* the system, always *to* it?
 
Second, regarding the strange error:
[ivy:install] ERROR: rc-fs: bad revision found in
C:\artifact-repositories\rc-repo\myorg\foo-module\1.0.0.0\ivy.xml:
expected='1.0.0.0 found='1.0.0'
[ivy:install] java.text.ParseException: inconsistent module descriptor
file found in
'C:\artifact-repositories\rc-repo\myorg\foo-module\1.0.0.0\ivy.xml': bad
revision: expected='1.0.0.0' found='1.0.0';
 
I don't understand the reasons for this error, because naturally the
original ivy file should not contain the modified revision number.
Even more odd, it seems to me that the semantic sense of the error is
reversed.   The so-called 'expected' revision 1.0.0.0 is definitely
found in the 1.0.0.0\ivy.xml file.   The so-called 'found' revision of
1.0.0 is, of course, not found in that any file (since 1.0.0 is the new
revision number to be installed).   So basically I'm totally confused as
to what went wrong.
 
I'd really appreciate help understanding this, I beat my head against it
for several hours and came no closer to understanding it.   I emulated
the tutorial as much as possible, but it seems I am having no luck.
 
Thanks,
Carlton



<HTML><BODY><P><hr size=1></P>
<P><STRONG>
====================================================
This message contains PRIVILEGED and CONFIDENTIAL
information that is intended only for use by the 
named recipient. If you are not the named recipient,
any disclosure, dissemination, or action based on 
the contents of this message is prohibited. In such
case please notify us and destroy and delete all 
copies of this transmission.  Thank you.
====================================================
</STRONG></P></BODY></HTML>

RE: Namespace problems

Posted by "Brown, Carlton" <Ca...@compucredit.com>.
Sorry to bring back a zombie thread... I'm still having this problem
with the namespace issue in RC1.  I did declare the to/from relationship
in both directions as Xavier asked earlier, and it seems that namespace
mapping still causes fatal error when transforming revision numbers.  

I was trying to use an install task, modeling the Ivy namespaces
tutorial as much as possible, but changing the revision suffix -rc3 to
-final3 instead of changing organisation from commons-.+ to apache like
the example did.

    <namespace name="promote-rc">
  		<rule>
  			<fromsystem>
				<src rev="(.+)-final(.+)"/>
				<dest rev="$r1-rc$r2"/>
  			</fromsystem>
    		<tosystem>
      			<src rev="(.+)-rc(.+)"/>
      			<dest rev="$r1-final$r2"/>
    		</tosystem>
  		</rule>
	</namespace>
	</namespaces> 

[ivy:install] 		local-staging: bad revision found in
C:\ivy\artifact-repositories\local-staging\com\ccrt\ols\dynaweb\1.0.0-rc
3\ivy.xml: expected='1.0.0-rc3 found='1.0.0-final3'
[ivy:install] 
[ivy:install] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS

BUILD FAILED
c:\allworkspaces\ebiz-1.6-rmtest\ivy-template\ivy-common.xml:169:
Problem happened while installing modules - see output for details
	at org.apache.ivy.ant.IvyInstall.doExecute(IvyInstall.java:113)
	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
	at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
05)
	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(DefaultExecut
or.java:41)
	at
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTar
gets(EclipseDefaultExecutor.java:32)
	at
org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAnt
Runner.java:423)
	at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAn
tRunner.java:137)

Total time: 1 second

* I know the resulting transform would result in a nonsensical value of
-finalN but that isn't important to this issue.

-----Original Message-----
From: Xavier Hanin [mailto:xavier.hanin@gmail.com] 
Sent: Friday, April 11, 2008 7:58 AM
To: ivy-user@ant.apache.org
Subject: Re: Namespace problems

On Thu, Apr 10, 2008 at 3:59 PM, Brown, Carlton <
Carlton.Brown@compucredit.com> wrote:

> I'd like to bump this topic one more time.  After more testing using 
> static revision numbers, I am still not able to use Ivy namespaces to 
> map revision numbers between repositories.  There's no problem with 
> organisations or modules.
>
> This time I used static revision numbers instead of expressions, in
> order to guarantee an 1:1 relationship.   For example, trying to map
> rev=1.0.0.1 to rev=1.0.0-final.   It kept failing with an error
similar
> to below, "inconsistent module descriptor".  It claims it "found" a 
> revision of 1.0.0-final inside ivy-1.0.01.xml (which is NOT contained 
> in the file), although it expected a revision of 1.0.0.1 (which truly 
> IS in the ivy-1.0.0.1.xml file).
>
> So does namespace mapping actually work for revisions?  Is there a 
> test case for this?

I doubt we have a test case for this, and I've never heard people using
namespaces for this, so I wouldn't be surprised if it's buggy. Just to
be sure, in your last test (with static revision) did you provide the
conversion rules in both ways (from and to system). Because I haven't
checked the code, but I think currently Ivy relies on both rules to
handle namespace properly.

Xavier


>
> > -----Original Message-----
> > From: Brown, Carlton [mailto:Carlton.Brown@compucredit.com]
> > Sent: Friday, April 04, 2008 1:52 PM
> > To: ivy-user@ant.apache.org
> > Subject: Namespace problems
> >
> > I'm getting errors I don't understand while using install with 
> > namespace and I'd appreciate any insight.
> >
> > Briefly, my intention is to copy foo-module-1.0.0.0 from an RC 
> > repository into a final repository with the version changed to 1.0.0

> > (truncating the final number).
> >
> > My rename rule looks like this:
> >
> > <rule>
> >      <fromsystem>
> >         <!-- Space holder, because although there will never be a 
> > fromsystem copy, Ivy still throws NPE if we don't include this xml 
> > element -->
> >      </fromsystem>
> >         <tosystem>
> >            <src rev="(.+)\.(.+)\.(.+)\.(.+)"/>
> >
> >            <dest rev="$r1\.$r2\.$r3"/>
> >
> >         </tosystem>
> > </rule>
> >
> > First, a question... clearly, the <fromsystem> is required because I

> > get a NullPointerException if it is not defined.
> > But am I wrong to think that <fromsystem> is unnecessary if I know 
> > that I will never install
> > *from* the system, always *to* it?
> >
> > Second, regarding the strange error:
> > [ivy:install] ERROR: rc-fs: bad revision found in
> > C:\artifact-repositories\rc-repo\myorg\foo-module\1.0.0.0\ivy.xml:
> > expected='1.0.0.0 found='1.0.0'
> > [ivy:install] java.text.ParseException: inconsistent module 
> > descriptor file found in 
> > 'C:\artifact-repositories\rc-repo\myorg\foo-module\1.0.0.0\ivy
> > .xml': bad
> > revision: expected='1.0.0.0' found='1.0.0';
> >
> > I don't understand the reasons for this error, because naturally the

> > original ivy file should not contain the modified revision number.
> > Even more odd, it seems to me that the semantic sense of the error
is
> > reversed.   The so-called 'expected' revision 1.0.0.0 is definitely
> > found in the 1.0.0.0\ivy.xml file.   The so-called 'found' revision
of
> > 1.0.0 is, of course, not found in that any file (since 1.0.0 is the 
> > new
> > revision number to be installed).   So basically I'm totally
> > confused as
> > to what went wrong.
> >
> > I'd really appreciate help understanding this, I beat my head 
> > against it
> > for several hours and came no closer to understanding it.   I
emulated
> > the tutorial as much as possible, but it seems I am having no luck.
> >
> > Thanks,
> > Carlton
> >
> >
> >
> > <HTML><BODY><P><hr size=1></P>
> > <P><STRONG>
> > ====================================================
> > This message contains PRIVILEGED and CONFIDENTIAL information that 
> > is intended only for use by the named recipient. If you are not the 
> > named recipient, any disclosure, dissemination, or action based on 
> > the contents of this message is prohibited. In such case please 
> > notify us and destroy and delete all copies of this transmission.  
> > Thank you.
> > ====================================================
> > </STRONG></P></BODY></HTML>
> >
>
> -----------------------------------------
> ====================================================
> This message contains PRIVILEGED and CONFIDENTIAL information that is 
> intended only for use by the named recipient. If you are not the named

> recipient, any disclosure, dissemination, or action based on the 
> contents of this message is prohibited. In such case please notify us 
> and destroy and delete all copies of this transmission.  Thank you.
> ====================================================
>



--
Xavier Hanin - Independent Java Consultant http://xhab.blogspot.com/
http://ant.apache.org/ivy/ http://www.xoocode.org/

Re: files without extensions as artifacts

Posted by Xavier Hanin <xa...@gmail.com>.
On Fri, Apr 11, 2008 at 9:10 PM, Shawn Castrianni <
Shawn.Castrianni@halliburton.com> wrote:

> 1. Shouldn't (.[ext]) be the default?  I can't think of why I would ever
> need a dot with an extension so it seems better to require the user to do
> something special to turn that on instead of the other way around.

It should be the default for patterns which are defined in Ivy. I'm sure for
cache patterns, not sure for ibiblio and ivyrep patterns though, neither for
retrieve pattern. Please open an issue if you see it's not the case.


>
> 2. Which pattern do I change to (.[ext])?  I have cache patterns, resolver
> patterns, retrieve patterns, and publish patterns.  Should I go ahead and
> change all of them?

The patterns where you don't want to get the extra dot. I think changing
them all is better, but if you only want to get rid of the extra dot once
the artifacts are retrieved, you only need to change your retrieve pattern.

Xavier

>
>
> ---
> Shawn Castrianni
> CM Chief Architect
> Landmark
> Halliburton Drilling, Evaluation and Digital Solutions Building 2
> 2101 City West Blvd.
> Houston, TX  77042
> Work:  713-839-3086
> Cell:  832-654-0888
> Fax:  713-839-2758
>
>
> -----Original Message-----
> > Does IVY support files without extensions as artifacts?
>
> Yes
>
>
> >
> >
> > I am getting this error looking for my policy file which has no
> extension:
> >
> >
> > [ivy:resolve]           ::::::::::::::::::::::::::::::::::::::::::::::
> >
> > [ivy:resolve]           ::              FAILED DOWNLOADS            ::
> >
> > [ivy:resolve]           :: ^ see resolution messages for details  ^ ::
> >
> > [ivy:resolve]           ::::::::::::::::::::::::::::::::::::::::::::::
> >
> > [ivy:resolve]           ::
> > Landmark#dsinfra#HEAD;R5000_1.HEAD.1!policy.(homes)
> >
> > [ivy:resolve]           ::::::::::::::::::::::::::::::::::::::::::::::
> >
> >
> > The (homes) is the type of the artifact and I specified the empty string
> > for the ext attribute since there is no extension.
>
> What pattern do you use? You can use conditional parts in your pattern to
> tell Ivy you don't want the dot when there's no extension. Eg
> [artifact](.[ext])
>
> Xavier
>
> >
> >
> > This is a show stopper for us.
> >
> >
> > ---
> > Shawn Castrianni
>
> ----------------------------------------------------------------------
> This e-mail, including any attached files, may contain confidential and
> privileged information for the sole use of the intended recipient.  Any
> review, use, distribution, or disclosure by others is strictly prohibited.
>  If you are not the intended recipient (or authorized to receive information
> for the intended recipient), please contact the sender by reply e-mail and
> delete all copies of this message.
>



-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Re: files without extensions as artifacts

Posted by Shawn Castrianni <Sh...@halliburton.com>.
1. Shouldn't (.[ext]) be the default?  I can't think of why I would ever need a dot with an extension so it seems better to require the user to do something special to turn that on instead of the other way around.

2. Which pattern do I change to (.[ext])?  I have cache patterns, resolver patterns, retrieve patterns, and publish patterns.  Should I go ahead and change all of them?

---
Shawn Castrianni
CM Chief Architect
Landmark
Halliburton Drilling, Evaluation and Digital Solutions Building 2
2101 City West Blvd.
Houston, TX  77042
Work:  713-839-3086
Cell:  832-654-0888
Fax:  713-839-2758


-----Original Message-----
> Does IVY support files without extensions as artifacts?

Yes


>
>
> I am getting this error looking for my policy file which has no extension:
>
>
> [ivy:resolve]           ::::::::::::::::::::::::::::::::::::::::::::::
>
> [ivy:resolve]           ::              FAILED DOWNLOADS            ::
>
> [ivy:resolve]           :: ^ see resolution messages for details  ^ ::
>
> [ivy:resolve]           ::::::::::::::::::::::::::::::::::::::::::::::
>
> [ivy:resolve]           ::
> Landmark#dsinfra#HEAD;R5000_1.HEAD.1!policy.(homes)
>
> [ivy:resolve]           ::::::::::::::::::::::::::::::::::::::::::::::
>
>
> The (homes) is the type of the artifact and I specified the empty string
> for the ext attribute since there is no extension.

What pattern do you use? You can use conditional parts in your pattern to
tell Ivy you don't want the dot when there's no extension. Eg
[artifact](.[ext])

Xavier

>
>
> This is a show stopper for us.
>
>
> ---
> Shawn Castrianni

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.

Re: Namespace problems

Posted by Xavier Hanin <xa...@gmail.com>.
On Thu, Apr 10, 2008 at 3:59 PM, Brown, Carlton <
Carlton.Brown@compucredit.com> wrote:

> I'd like to bump this topic one more time.  After more testing using
> static revision numbers, I am still not able to use Ivy namespaces to
> map revision numbers between repositories.  There's no problem with
> organisations or modules.
>
> This time I used static revision numbers instead of expressions, in
> order to guarantee an 1:1 relationship.   For example, trying to map
> rev=1.0.0.1 to rev=1.0.0-final.   It kept failing with an error similar
> to below, "inconsistent module descriptor".  It claims it "found" a
> revision of 1.0.0-final inside ivy-1.0.01.xml (which is NOT contained in
> the file), although it expected a revision of 1.0.0.1 (which truly IS in
> the ivy-1.0.0.1.xml file).
>
> So does namespace mapping actually work for revisions?  Is there a test
> case for this?

I doubt we have a test case for this, and I've never heard people using
namespaces for this, so I wouldn't be surprised if it's buggy. Just to be
sure, in your last test (with static revision) did you provide the
conversion rules in both ways (from and to system). Because I haven't
checked the code, but I think currently Ivy relies on both rules to handle
namespace properly.

Xavier


>
> > -----Original Message-----
> > From: Brown, Carlton [mailto:Carlton.Brown@compucredit.com]
> > Sent: Friday, April 04, 2008 1:52 PM
> > To: ivy-user@ant.apache.org
> > Subject: Namespace problems
> >
> > I'm getting errors I don't understand while using install
> > with namespace
> > and I'd appreciate any insight.
> >
> > Briefly, my intention is to copy foo-module-1.0.0.0 from an
> > RC repository into a final repository with the version
> > changed to 1.0.0 (truncating the final number).
> >
> > My rename rule looks like this:
> >
> > <rule>
> >      <fromsystem>
> >         <!-- Space holder, because although there will never
> > be a fromsystem copy, Ivy still throws NPE if we don't
> > include this xml element -->
> >      </fromsystem>
> >         <tosystem>
> >            <src rev="(.+)\.(.+)\.(.+)\.(.+)"/>
> >
> >            <dest rev="$r1\.$r2\.$r3"/>
> >
> >         </tosystem>
> > </rule>
> >
> > First, a question... clearly, the <fromsystem> is required
> > because I get a NullPointerException if it is not defined.
> > But am I wrong to think that <fromsystem> is unnecessary if I
> > know that I will never install
> > *from* the system, always *to* it?
> >
> > Second, regarding the strange error:
> > [ivy:install] ERROR: rc-fs: bad revision found in
> > C:\artifact-repositories\rc-repo\myorg\foo-module\1.0.0.0\ivy.xml:
> > expected='1.0.0.0 found='1.0.0'
> > [ivy:install] java.text.ParseException: inconsistent module
> > descriptor file found in
> > 'C:\artifact-repositories\rc-repo\myorg\foo-module\1.0.0.0\ivy
> > .xml': bad
> > revision: expected='1.0.0.0' found='1.0.0';
> >
> > I don't understand the reasons for this error, because
> > naturally the original ivy file should not contain the
> > modified revision number.
> > Even more odd, it seems to me that the semantic sense of the error is
> > reversed.   The so-called 'expected' revision 1.0.0.0 is definitely
> > found in the 1.0.0.0\ivy.xml file.   The so-called 'found' revision of
> > 1.0.0 is, of course, not found in that any file (since 1.0.0
> > is the new
> > revision number to be installed).   So basically I'm totally
> > confused as
> > to what went wrong.
> >
> > I'd really appreciate help understanding this, I beat my head
> > against it
> > for several hours and came no closer to understanding it.   I emulated
> > the tutorial as much as possible, but it seems I am having no luck.
> >
> > Thanks,
> > Carlton
> >
> >
> >
> > <HTML><BODY><P><hr size=1></P>
> > <P><STRONG>
> > ====================================================
> > This message contains PRIVILEGED and CONFIDENTIAL information
> > that is intended only for use by the named recipient. If you
> > are not the named recipient, any disclosure, dissemination,
> > or action based on the contents of this message is
> > prohibited. In such case please notify us and destroy and
> > delete all copies of this transmission.  Thank you.
> > ====================================================
> > </STRONG></P></BODY></HTML>
> >
>
> -----------------------------------------
> ====================================================
> This message contains PRIVILEGED and CONFIDENTIAL
> information that is intended only for use by the
> named recipient. If you are not the named recipient,
> any disclosure, dissemination, or action based on
> the contents of this message is prohibited. In such
> case please notify us and destroy and delete all
> copies of this transmission.  Thank you.
> ====================================================
>



-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

RE: Namespace problems

Posted by "Brown, Carlton" <Ca...@compucredit.com>.
I'd like to bump this topic one more time.  After more testing using
static revision numbers, I am still not able to use Ivy namespaces to
map revision numbers between repositories.  There's no problem with
organisations or modules. 

This time I used static revision numbers instead of expressions, in
order to guarantee an 1:1 relationship.   For example, trying to map
rev=1.0.0.1 to rev=1.0.0-final.   It kept failing with an error similar
to below, "inconsistent module descriptor".  It claims it "found" a
revision of 1.0.0-final inside ivy-1.0.01.xml (which is NOT contained in
the file), although it expected a revision of 1.0.0.1 (which truly IS in
the ivy-1.0.0.1.xml file).

So does namespace mapping actually work for revisions?  Is there a test
case for this?

> -----Original Message-----
> From: Brown, Carlton [mailto:Carlton.Brown@compucredit.com] 
> Sent: Friday, April 04, 2008 1:52 PM
> To: ivy-user@ant.apache.org
> Subject: Namespace problems
> 
> I'm getting errors I don't understand while using install 
> with namespace
> and I'd appreciate any insight.   
>  
> Briefly, my intention is to copy foo-module-1.0.0.0 from an 
> RC repository into a final repository with the version 
> changed to 1.0.0 (truncating the final number).
>  
> My rename rule looks like this:
> 
> <rule>
>      <fromsystem>
>         <!-- Space holder, because although there will never 
> be a fromsystem copy, Ivy still throws NPE if we don't 
> include this xml element -->
>      </fromsystem>
>         <tosystem>
>            <src rev="(.+)\.(.+)\.(.+)\.(.+)"/>
>            
>            <dest rev="$r1\.$r2\.$r3"/>
>  
>         </tosystem>
> </rule>
>  
> First, a question... clearly, the <fromsystem> is required 
> because I get a NullPointerException if it is not defined.  
> But am I wrong to think that <fromsystem> is unnecessary if I 
> know that I will never install
> *from* the system, always *to* it?
>  
> Second, regarding the strange error:
> [ivy:install] ERROR: rc-fs: bad revision found in
> C:\artifact-repositories\rc-repo\myorg\foo-module\1.0.0.0\ivy.xml:
> expected='1.0.0.0 found='1.0.0'
> [ivy:install] java.text.ParseException: inconsistent module 
> descriptor file found in
> 'C:\artifact-repositories\rc-repo\myorg\foo-module\1.0.0.0\ivy
> .xml': bad
> revision: expected='1.0.0.0' found='1.0.0';
>  
> I don't understand the reasons for this error, because 
> naturally the original ivy file should not contain the 
> modified revision number.
> Even more odd, it seems to me that the semantic sense of the error is
> reversed.   The so-called 'expected' revision 1.0.0.0 is definitely
> found in the 1.0.0.0\ivy.xml file.   The so-called 'found' revision of
> 1.0.0 is, of course, not found in that any file (since 1.0.0 
> is the new
> revision number to be installed).   So basically I'm totally 
> confused as
> to what went wrong.
>  
> I'd really appreciate help understanding this, I beat my head 
> against it
> for several hours and came no closer to understanding it.   I emulated
> the tutorial as much as possible, but it seems I am having no luck.
>  
> Thanks,
> Carlton
> 
> 
> 
> <HTML><BODY><P><hr size=1></P>
> <P><STRONG>
> ====================================================
> This message contains PRIVILEGED and CONFIDENTIAL information 
> that is intended only for use by the named recipient. If you 
> are not the named recipient, any disclosure, dissemination, 
> or action based on the contents of this message is 
> prohibited. In such case please notify us and destroy and 
> delete all copies of this transmission.  Thank you.
> ====================================================
> </STRONG></P></BODY></HTML>
> 

-----------------------------------------
====================================================
This message contains PRIVILEGED and CONFIDENTIAL
information that is intended only for use by the 
named recipient. If you are not the named recipient,
any disclosure, dissemination, or action based on 
the contents of this message is prohibited. In such
case please notify us and destroy and delete all 
copies of this transmission.  Thank you.
====================================================