You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by kermitt <he...@genesys.com> on 2008/01/10 00:41:51 UTC

ivy:install

I attached my previous post from user mailling. I take a moment tonight to
figure out the error.

In my mind, I wanted to synchronize two repositories which is not possible
regarding the code. As if overwrite is set to false an IOException is thrown
as soon as an existing artifact is found. 

I feel like synchronization would be a good feature, what do you think of?  

There is different way to handle the feature but it would requires API
change somehow. We need distingate the case of an exception of Input Output
and the "file already exist" case.

Some suggestions:

void publish(Artifact artifact, File src, boolean overwrite) throws
IOException, ExistingArtifactUncheckedException;

=> Would unify error message regarding duplicate as IOException is filled
with various message according the resolver.

void publish(Artifact artifact, File src, boolean overwrite,boolean
skipExistingFile) throws IOException;

....




Trace confuse me a bit , I am using SFTP and I would suggest to add to
SFTPRepository.java line 137:
            if (!overwrite && checkExistence(destination, c)) {
                throw new IOException("destination file " + destination + "
exists and overwrite == true");
            }

regards,


Hello,

I have two repo : local , integration

I tried to use ivy:install to migrate my modules between them. 

After publishing in local, i start a new task to migrate new dependencies I
could have added to my local repo during my developpement:

<ivy:install organisation="${ivy.organisation}" module="${ivy.module}"
revision="${ivy.revision}" from="local" to="integration" transitive="true"
/>	


[ivy:install] :: installing com.foo.test#Basic;1.53 ::
[ivy:install] :: resolving dependencies ::
[ivy:install] 	found com.foo.test#Basic;1.53 in fs-local
[ivy:install] 	found foo#AntCommon;1.39D in remote-private
[ivy:install] 	found junit#junit;3.8.1 in remote-private
[ivy:install] :: downloading artifacts to cache ::
[ivy:install] downloading
d:\javadev\local-repository\com.foo.test\Basic\jars\Basic-1.53.jar ...
[ivy:install] .. (1kB)
[ivy:install] .. (0kB)
[ivy:install] 	[SUCCESSFUL ] com.foo.test#Basic;1.53!Basic.jar (20ms)
[ivy:install] :: installing in remote ::
[ivy:install] 	published Basic to
./repository/private/com.foo.test/Basic/jars/Basic-1.53.jar
[ivy:install] 	published ivy to
./repository/private/com.foo.test/Basic/ivy-1.53.xml
[ivy:install] missing artifact foo#AntCommon;1.39D!AntCommon.zip:
[ivy:install]
d:\javadev\repository\.ivy-cache\foo\AntCommon\zips\AntCommon-1.39D.zip file
does not exist

BUILD FAILED
C:\javadev\src\AntCommon\src\build-common.xml:321: impossible to install
com.foo.test#Basic;1.53: java.io.IOException: destination file exists and
overwrite == true

Total time: 1 minute 1 second



I tried with ivy 1.4.1 and ivy 2.0 beta 1 same error, if I put transitive to
false I don't get this error. I guess there is an issue with the artifact
being reprocessed one more time when transitive. 
I don't really want to put overwrite="true" because I have so many artifact
it would take too long ...


-- 
View this message in context: http://www.nabble.com/ivy%3Ainstall-tp14724560p14724560.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: ivy:install

Posted by Xavier Hanin <xa...@gmail.com>.
On Jan 10, 2008 9:48 PM, kermitt <he...@genesys.com> wrote:

>
> I am using a repository to sync module within the team => integration repo
> when we release a module we put the module inside another repository
> (test). This is intended to avoid conflict and issue between test team and
> dev team.

Ok, so I guess the test team repository is what you call production
repository? It makes sense to keep them isolated, moving to the test repo is
like a promotion.  So I guess we can conclude I agree it would be useful to
have a synchronization feature for the install task.

Xavier

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

Re: ivy:install

Posted by kermitt <he...@genesys.com>.
I am using a repository to sync module within the team => integration repo 
when we release a module we put the module inside another repository 
(test). This is intended to avoid conflict and issue between test team and
dev team.
 


Xavier Hanin wrote:
> 
>>
>> Do you share your integration repository and production ?
> 
> What do you mean?
> 
> Xavier
> 
> 
-- 
View this message in context: http://www.nabble.com/ivy%3Ainstall-tp14724560p14743255.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: ivy:install

Posted by Xavier Hanin <xa...@gmail.com>.
On Jan 10, 2008 8:36 PM, kermitt <he...@genesys.com> wrote:

>
> well, backward compatibility requires to keep the current  Resolver
> behaviour, overwrite = false make your build stop if a file already
> exists.
> So the API need to change to allow user to tell that he want
> synchronization.

Indeed, I was only speaking about the change of Exception raised when the
file is present.


> I feel like this is going to break a lot of code,

Mostly code in Ivy only, which is already in deep API change currently for
2.0

> is it
> usefull ?

I don't know, I've never had this use case before, but it sounds like it may
be useful.


>
>
> Before really coding , I would like to be confident that this feature is
> really helpful ,
>
> Do you share your integration repository and production ?

What do you mean?

Xavier


>
>
>
> Xavier Hanin wrote:
> >
> > On Jan 10, 2008 12:41 AM, kermitt <he...@genesys.com> wrote:
> >
> >>
> >> I attached my previous post from user mailling. I take a moment tonight
> >> to
> >> figure out the error.
> >>
> >> In my mind, I wanted to synchronize two repositories which is not
> >> possible
> >> regarding the code. As if overwrite is set to false an IOException is
> >> thrown
> >> as soon as an existing artifact is found.
> >>
> >> I feel like synchronization would be a good feature, what do you think
> >> of?
> >>
> >> There is different way to handle the feature but it would requires API
> >> change somehow. We need distingate the case of an exception of Input
> >> Output
> >> and the "file already exist" case.
> >>
> >> Some suggestions:
> >>
> >> void publish(Artifact artifact, File src, boolean overwrite) throws
> >> IOException, ExistingArtifactUncheckedException;
> >>
> >> => Would unify error message regarding duplicate as IOException is
> filled
> >> with various message according the resolver.
> >>
> >> void publish(Artifact artifact, File src, boolean overwrite,boolean
> >> skipExistingFile) throws IOException;
> >
> >
> > If we make ExistingArtifactException extends IOException we keep the
> same
> > API and we still have finer grain information as you want.
> >
> > Feel free to open an issue, and maybe attach a patch since you seem to
> > already have a pretty clear idea of what you want (don't forget unit
> test
> > to
> > increase chance to get included).
> >
> > Xavier
> >
> >>
> >>
> >> ....
> >>
> >>
> >>
> >>
> >> Trace confuse me a bit , I am using SFTP and I would suggest to add to
> >> SFTPRepository.java line 137:
> >>            if (!overwrite && checkExistence(destination, c)) {
> >>                throw new IOException("destination file " + destination
> +
> >> "
> >> exists and overwrite == true");
> >>            }
> >>
> >> regards,
> >>
> >>
> >> Hello,
> >>
> >> I have two repo : local , integration
> >>
> >> I tried to use ivy:install to migrate my modules between them.
> >>
> >> After publishing in local, i start a new task to migrate new
> dependencies
> >> I
> >> could have added to my local repo during my developpement:
> >>
> >> <ivy:install organisation="${ivy.organisation}" module="${ivy.module}"
> >> revision="${ivy.revision}" from="local" to="integration"
> >> transitive="true"
> >> />
> >>
> >>
> >> [ivy:install] :: installing com.foo.test#Basic;1.53 ::
> >> [ivy:install] :: resolving dependencies ::
> >> [ivy:install]   found com.foo.test#Basic;1.53 in fs-local
> >> [ivy:install]   found foo#AntCommon;1.39D in remote-private
> >> [ivy:install]   found junit#junit;3.8.1 in remote-private
> >> [ivy:install] :: downloading artifacts to cache ::
> >> [ivy:install] downloading
> >> d:\javadev\local-repository\com.foo.test\Basic\jars\Basic-1.53.jar ...
> >> [ivy:install] .. (1kB)
> >> [ivy:install] .. (0kB)
> >> [ivy:install]   [SUCCESSFUL ] com.foo.test#Basic;1.53!Basic.jar (20ms)
> >> [ivy:install] :: installing in remote ::
> >> [ivy:install]   published Basic to
> >> ./repository/private/com.foo.test/Basic/jars/Basic-1.53.jar
> >> [ivy:install]   published ivy to
> >> ./repository/private/com.foo.test/Basic/ivy-1.53.xml
> >> [ivy:install] missing artifact foo#AntCommon;1.39D!AntCommon.zip:
> >> [ivy:install]
> >> d:\javadev\repository\.ivy-cache\foo\AntCommon\zips\AntCommon-
> 1.39D.zipfile
> >> does not exist
> >>
> >> BUILD FAILED
> >> C:\javadev\src\AntCommon\src\build-common.xml:321: impossible to
> install
> >> com.foo.test#Basic;1.53: java.io.IOException: destination file exists
> and
> >> overwrite == true
> >>
> >> Total time: 1 minute 1 second
> >>
> >>
> >>
> >> I tried with ivy 1.4.1 and ivy 2.0 beta 1 same error, if I put
> transitive
> >> to
> >> false I don't get this error. I guess there is an issue with the
> artifact
> >> being reprocessed one more time when transitive.
> >> I don't really want to put overwrite="true" because I have so many
> >> artifact
> >> it would take too long ...
> >>
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/ivy%3Ainstall-tp14724560p14724560.html
> >> Sent from the Ant - Dev mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> >> For additional commands, e-mail: dev-help@ant.apache.org
> >>
> >>
> >
> >
> > --
> > Xavier Hanin - Independent Java Consultant
> > http://xhab.blogspot.com/
> > http://ant.apache.org/ivy/
> > http://www.xoocode.org/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/ivy%3Ainstall-tp14724560p14741900.html
> Sent from the Ant - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>


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

Re: ivy:install

Posted by kermitt <he...@genesys.com>.
well, backward compatibility requires to keep the current  Resolver
behaviour, overwrite = false make your build stop if a file already exists.
So the API need to change to allow user to tell that he want
synchronization. I feel like this is going to break a lot of code, is it
usefull ? 

Before really coding , I would like to be confident that this feature is
really helpful , 

Do you share your integration repository and production ? 


Xavier Hanin wrote:
> 
> On Jan 10, 2008 12:41 AM, kermitt <he...@genesys.com> wrote:
> 
>>
>> I attached my previous post from user mailling. I take a moment tonight
>> to
>> figure out the error.
>>
>> In my mind, I wanted to synchronize two repositories which is not
>> possible
>> regarding the code. As if overwrite is set to false an IOException is
>> thrown
>> as soon as an existing artifact is found.
>>
>> I feel like synchronization would be a good feature, what do you think
>> of?
>>
>> There is different way to handle the feature but it would requires API
>> change somehow. We need distingate the case of an exception of Input
>> Output
>> and the "file already exist" case.
>>
>> Some suggestions:
>>
>> void publish(Artifact artifact, File src, boolean overwrite) throws
>> IOException, ExistingArtifactUncheckedException;
>>
>> => Would unify error message regarding duplicate as IOException is filled
>> with various message according the resolver.
>>
>> void publish(Artifact artifact, File src, boolean overwrite,boolean
>> skipExistingFile) throws IOException;
> 
> 
> If we make ExistingArtifactException extends IOException we keep the same
> API and we still have finer grain information as you want.
> 
> Feel free to open an issue, and maybe attach a patch since you seem to
> already have a pretty clear idea of what you want (don't forget unit test
> to
> increase chance to get included).
> 
> Xavier
> 
>>
>>
>> ....
>>
>>
>>
>>
>> Trace confuse me a bit , I am using SFTP and I would suggest to add to
>> SFTPRepository.java line 137:
>>            if (!overwrite && checkExistence(destination, c)) {
>>                throw new IOException("destination file " + destination +
>> "
>> exists and overwrite == true");
>>            }
>>
>> regards,
>>
>>
>> Hello,
>>
>> I have two repo : local , integration
>>
>> I tried to use ivy:install to migrate my modules between them.
>>
>> After publishing in local, i start a new task to migrate new dependencies
>> I
>> could have added to my local repo during my developpement:
>>
>> <ivy:install organisation="${ivy.organisation}" module="${ivy.module}"
>> revision="${ivy.revision}" from="local" to="integration"
>> transitive="true"
>> />
>>
>>
>> [ivy:install] :: installing com.foo.test#Basic;1.53 ::
>> [ivy:install] :: resolving dependencies ::
>> [ivy:install]   found com.foo.test#Basic;1.53 in fs-local
>> [ivy:install]   found foo#AntCommon;1.39D in remote-private
>> [ivy:install]   found junit#junit;3.8.1 in remote-private
>> [ivy:install] :: downloading artifacts to cache ::
>> [ivy:install] downloading
>> d:\javadev\local-repository\com.foo.test\Basic\jars\Basic-1.53.jar ...
>> [ivy:install] .. (1kB)
>> [ivy:install] .. (0kB)
>> [ivy:install]   [SUCCESSFUL ] com.foo.test#Basic;1.53!Basic.jar (20ms)
>> [ivy:install] :: installing in remote ::
>> [ivy:install]   published Basic to
>> ./repository/private/com.foo.test/Basic/jars/Basic-1.53.jar
>> [ivy:install]   published ivy to
>> ./repository/private/com.foo.test/Basic/ivy-1.53.xml
>> [ivy:install] missing artifact foo#AntCommon;1.39D!AntCommon.zip:
>> [ivy:install]
>> d:\javadev\repository\.ivy-cache\foo\AntCommon\zips\AntCommon-1.39D.zipfile
>> does not exist
>>
>> BUILD FAILED
>> C:\javadev\src\AntCommon\src\build-common.xml:321: impossible to install
>> com.foo.test#Basic;1.53: java.io.IOException: destination file exists and
>> overwrite == true
>>
>> Total time: 1 minute 1 second
>>
>>
>>
>> I tried with ivy 1.4.1 and ivy 2.0 beta 1 same error, if I put transitive
>> to
>> false I don't get this error. I guess there is an issue with the artifact
>> being reprocessed one more time when transitive.
>> I don't really want to put overwrite="true" because I have so many
>> artifact
>> it would take too long ...
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/ivy%3Ainstall-tp14724560p14724560.html
>> Sent from the Ant - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>>
>>
> 
> 
> -- 
> Xavier Hanin - Independent Java Consultant
> http://xhab.blogspot.com/
> http://ant.apache.org/ivy/
> http://www.xoocode.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/ivy%3Ainstall-tp14724560p14741900.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: ivy:install

Posted by Xavier Hanin <xa...@gmail.com>.
On Jan 10, 2008 12:41 AM, kermitt <he...@genesys.com> wrote:

>
> I attached my previous post from user mailling. I take a moment tonight to
> figure out the error.
>
> In my mind, I wanted to synchronize two repositories which is not possible
> regarding the code. As if overwrite is set to false an IOException is
> thrown
> as soon as an existing artifact is found.
>
> I feel like synchronization would be a good feature, what do you think of?
>
> There is different way to handle the feature but it would requires API
> change somehow. We need distingate the case of an exception of Input
> Output
> and the "file already exist" case.
>
> Some suggestions:
>
> void publish(Artifact artifact, File src, boolean overwrite) throws
> IOException, ExistingArtifactUncheckedException;
>
> => Would unify error message regarding duplicate as IOException is filled
> with various message according the resolver.
>
> void publish(Artifact artifact, File src, boolean overwrite,boolean
> skipExistingFile) throws IOException;


If we make ExistingArtifactException extends IOException we keep the same
API and we still have finer grain information as you want.

Feel free to open an issue, and maybe attach a patch since you seem to
already have a pretty clear idea of what you want (don't forget unit test to
increase chance to get included).

Xavier

>
>
> ....
>
>
>
>
> Trace confuse me a bit , I am using SFTP and I would suggest to add to
> SFTPRepository.java line 137:
>            if (!overwrite && checkExistence(destination, c)) {
>                throw new IOException("destination file " + destination + "
> exists and overwrite == true");
>            }
>
> regards,
>
>
> Hello,
>
> I have two repo : local , integration
>
> I tried to use ivy:install to migrate my modules between them.
>
> After publishing in local, i start a new task to migrate new dependencies
> I
> could have added to my local repo during my developpement:
>
> <ivy:install organisation="${ivy.organisation}" module="${ivy.module}"
> revision="${ivy.revision}" from="local" to="integration" transitive="true"
> />
>
>
> [ivy:install] :: installing com.foo.test#Basic;1.53 ::
> [ivy:install] :: resolving dependencies ::
> [ivy:install]   found com.foo.test#Basic;1.53 in fs-local
> [ivy:install]   found foo#AntCommon;1.39D in remote-private
> [ivy:install]   found junit#junit;3.8.1 in remote-private
> [ivy:install] :: downloading artifacts to cache ::
> [ivy:install] downloading
> d:\javadev\local-repository\com.foo.test\Basic\jars\Basic-1.53.jar ...
> [ivy:install] .. (1kB)
> [ivy:install] .. (0kB)
> [ivy:install]   [SUCCESSFUL ] com.foo.test#Basic;1.53!Basic.jar (20ms)
> [ivy:install] :: installing in remote ::
> [ivy:install]   published Basic to
> ./repository/private/com.foo.test/Basic/jars/Basic-1.53.jar
> [ivy:install]   published ivy to
> ./repository/private/com.foo.test/Basic/ivy-1.53.xml
> [ivy:install] missing artifact foo#AntCommon;1.39D!AntCommon.zip:
> [ivy:install]
> d:\javadev\repository\.ivy-cache\foo\AntCommon\zips\AntCommon-1.39D.zipfile
> does not exist
>
> BUILD FAILED
> C:\javadev\src\AntCommon\src\build-common.xml:321: impossible to install
> com.foo.test#Basic;1.53: java.io.IOException: destination file exists and
> overwrite == true
>
> Total time: 1 minute 1 second
>
>
>
> I tried with ivy 1.4.1 and ivy 2.0 beta 1 same error, if I put transitive
> to
> false I don't get this error. I guess there is an issue with the artifact
> being reprocessed one more time when transitive.
> I don't really want to put overwrite="true" because I have so many
> artifact
> it would take too long ...
>
>
> --
> View this message in context:
> http://www.nabble.com/ivy%3Ainstall-tp14724560p14724560.html
> Sent from the Ant - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>


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