[jira] Resolved: (IVY-814) Filesystem resolver does not evaluate [branch] token when publishing

2008-05-05 Thread Maarten Coene (JIRA)

 [ 
https://issues.apache.org/jira/browse/IVY-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maarten Coene resolved IVY-814.
---

Resolution: Fixed

I've updated the IvyPatternHelper class to also use the branch when a 
ModuleRevisionId is passed + added a JUnit test.
Thanks for reporting this!

> Filesystem resolver does not evaluate [branch] token when publishing
> 
>
> Key: IVY-814
> URL: https://issues.apache.org/jira/browse/IVY-814
> Project: Ivy
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.0.0-beta-1, 2.0.0-beta-2
> Environment: Found on Mac OS X, but  should be reproduced everywhere
>Reporter: Ivan "Rambius" Ivanov
>Assignee: Maarten Coene
> Fix For: 2.0-RC1
>
> Attachments: FileSystemResolver.diff, IVY-814.zip
>
>
> I have the following settings file
> {noformat}
> 
>   
>   
>   
> 
>pattern="${repository.dir}/[organisation]/[module]/[branch]/[revision]/ivy.xml"/>
>pattern="${repository.dir}/[organisation]/[module]/[branch]/[revision]/[artifact].[ext]"/>
> 
>   
>   
> 
>   
> 
> {noformat}
> For all project in my organisation I want to use branch br-1. However, after 
> I configure ivy, download the dependencies, build my project and I attempt to 
> publish it, I receive the following output:
> {noformat}
> :: publishing :: claudia.homeunix.net#hwlib
>   published hwlib to 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/br-1/1.0.part/hwlib.jar
>   published ivy to 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/br-1/1.0.part/ivy.xml
>   publish commited: moved 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0.part 
>   to /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0 
> {noformat}
> I use the latest from trunk updated today.
> As it can be seen the artifacts are published to the repository, but when 
> they are committed the branch is skipped from the URL - the directory 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0  does not exist at all.
> I traced the reason of this behaviour down to 
> FileSystemResolver.initTransaction(ModuleRevisionId module). There it 
> initializes from the artifact pattern defined in the settings file the 
> transaction's temporary directory and the transaction's destination 
> directory, respectively the String variables transactionTempDir and 
> transactionDestDir. The patterns are substituted using 
> IvyPatternHelper.substitute(String pattern, ModuleRevisionId moduleRevision) 
> and the problem lies in this method - it does not use the branch.
> I am submitting a patch of FileSystemResolver that uses 
> IvyPatternHelper.substitute(String pattern, String org, String module, String 
> branch, String revision, String artifact, String type, String ext, String 
> conf, ArtifactOrigin origin, Map extraAttributes)
> as this is the only method that uses the branch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (IVY-814) Filesystem resolver does not evaluate [branch] token when publishing

2008-05-05 Thread Maarten Coene (JIRA)

 [ 
https://issues.apache.org/jira/browse/IVY-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maarten Coene updated IVY-814:
--

Affects Version/s: (was: 2.0-RC1)
Fix Version/s: 2.0-RC1
  Summary: Filesystem resolver does not evaluate [branch] token 
when publishing  (was: Filesystem resolver does not work with branches)

> Filesystem resolver does not evaluate [branch] token when publishing
> 
>
> Key: IVY-814
> URL: https://issues.apache.org/jira/browse/IVY-814
> Project: Ivy
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.0.0-beta-1, 2.0.0-beta-2
> Environment: Found on Mac OS X, but  should be reproduced everywhere
>Reporter: Ivan "Rambius" Ivanov
>Assignee: Maarten Coene
> Fix For: 2.0-RC1
>
> Attachments: FileSystemResolver.diff, IVY-814.zip
>
>
> I have the following settings file
> {noformat}
> 
>   
>   
>   
> 
>pattern="${repository.dir}/[organisation]/[module]/[branch]/[revision]/ivy.xml"/>
>pattern="${repository.dir}/[organisation]/[module]/[branch]/[revision]/[artifact].[ext]"/>
> 
>   
>   
> 
>   
> 
> {noformat}
> For all project in my organisation I want to use branch br-1. However, after 
> I configure ivy, download the dependencies, build my project and I attempt to 
> publish it, I receive the following output:
> {noformat}
> :: publishing :: claudia.homeunix.net#hwlib
>   published hwlib to 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/br-1/1.0.part/hwlib.jar
>   published ivy to 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/br-1/1.0.part/ivy.xml
>   publish commited: moved 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0.part 
>   to /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0 
> {noformat}
> I use the latest from trunk updated today.
> As it can be seen the artifacts are published to the repository, but when 
> they are committed the branch is skipped from the URL - the directory 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0  does not exist at all.
> I traced the reason of this behaviour down to 
> FileSystemResolver.initTransaction(ModuleRevisionId module). There it 
> initializes from the artifact pattern defined in the settings file the 
> transaction's temporary directory and the transaction's destination 
> directory, respectively the String variables transactionTempDir and 
> transactionDestDir. The patterns are substituted using 
> IvyPatternHelper.substitute(String pattern, ModuleRevisionId moduleRevision) 
> and the problem lies in this method - it does not use the branch.
> I am submitting a patch of FileSystemResolver that uses 
> IvyPatternHelper.substitute(String pattern, String org, String module, String 
> branch, String revision, String artifact, String type, String ext, String 
> conf, ArtifactOrigin origin, Map extraAttributes)
> as this is the only method that uses the branch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



svn commit: r653610 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/core/IvyPatternHelper.java test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java

2008-05-05 Thread maartenc
Author: maartenc
Date: Mon May  5 14:43:23 2008
New Revision: 653610

URL: http://svn.apache.org/viewvc?rev=653610&view=rev
Log:
FIX: Filesystem resolver does not evaluate [branch] token when publishing 
(IVY-814)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=653610&r1=653609&r2=653610&view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon May  5 14:43:23 2008
@@ -79,6 +79,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: Filesystem resolver does not evaluate [branch] token when publishing 
(IVY-814)
 - FIX: Using ivy:settings with the "id" attribute not behaving as expected 
(IVY-809)
 - FIX: onMissingDescriptor doesn't work due to == comparison (IVY-805) (thanks 
to Ben Hale)
 - FIX: revision token is not set in report outputpattern (IVY-272)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java?rev=653610&r1=653609&r2=653610&view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java Mon 
May  5 14:43:23 2008
@@ -69,8 +69,8 @@
 
 public static String substitute(String pattern, ModuleRevisionId 
moduleRevision) {
 return substitute(pattern, moduleRevision.getOrganisation(), 
moduleRevision.getName(),
-moduleRevision.getRevision(), "ivy", "ivy", "xml", null,
-moduleRevision.getAttributes());
+moduleRevision.getBranch(), moduleRevision.getRevision(), "ivy", 
"ivy", "xml", null,
+null, moduleRevision.getAttributes());
 }
 
 public static String substitute(String pattern, ModuleRevisionId 
moduleRevision,

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java?rev=653610&r1=653609&r2=653610&view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
 Mon May  5 14:43:23 2008
@@ -633,6 +633,45 @@
 }
 }
 
+public void testPublishTransactionWithBranch() throws Exception {
+try {
+FileSystemResolver resolver = new FileSystemResolver();
+resolver.setName("test");
+resolver.setSettings(settings);
+
+resolver.addIvyPattern(
+
"test/repositories/1/[organisation]/[module]/[branch]/[revision]/[artifact].[ext]");
+resolver.addArtifactPattern(
+ 
"test/repositories/1/[organisation]/[module]/[branch]/[revision]/[artifact]-[revision].[ext]");
+
+ModuleRevisionId mrid = ModuleRevisionId.newInstance("myorg", 
"mymodule", "mybranch", "myrevision");
+Artifact ivyArtifact = new DefaultArtifact(mrid, new Date(), 
"ivy", "ivy", "xml");
+Artifact artifact = new DefaultArtifact(mrid, new Date(), 
"myartifact", "mytype",
+"myext");
+File src = new File("test/repositories/ivysettings.xml");
+
+resolver.beginPublishTransaction(mrid, false);
+
+// files should not be available until the transaction is committed
+resolver.publish(ivyArtifact, src, false);
+assertFalse(new 
File("test/repositories/1/myorg/mymodule/mybranch/myrevision/ivy.xml").exists());
+
+resolver.publish(artifact, src, false);
+assertFalse(new File(
+
"test/repositories/1/myorg/mymodule/mybranch/myrevision/myartifact-myrevision.myext")
+.exists());
+
+resolver.commitPublishTransaction();
+
+assertTrue(new 
File("test/repositories/1/myorg/mymodule/mybranch/myrevision/ivy.xml").exists());
+assertTrue(new File(
+
"test/repositories/1/myorg/mymodule/mybranch/myrevision/myartifact-myrevision.myext")
+.exists());
+} finally {
+FileUtil.forceDelete(new File("test/repositories/1/myorg"));
+}
+}
+
 public void

[jira] Assigned: (IVY-814) Filesystem resolver does not work with branches

2008-05-05 Thread Maarten Coene (JIRA)

 [ 
https://issues.apache.org/jira/browse/IVY-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maarten Coene reassigned IVY-814:
-

Assignee: Maarten Coene

> Filesystem resolver does not work with branches
> ---
>
> Key: IVY-814
> URL: https://issues.apache.org/jira/browse/IVY-814
> Project: Ivy
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.0.0-beta-1, 2.0.0-beta-2, 2.0-RC1
> Environment: Found on Mac OS X, but  should be reproduced everywhere
>Reporter: Ivan "Rambius" Ivanov
>Assignee: Maarten Coene
> Attachments: FileSystemResolver.diff, IVY-814.zip
>
>
> I have the following settings file
> {noformat}
> 
>   
>   
>   
> 
>pattern="${repository.dir}/[organisation]/[module]/[branch]/[revision]/ivy.xml"/>
>pattern="${repository.dir}/[organisation]/[module]/[branch]/[revision]/[artifact].[ext]"/>
> 
>   
>   
> 
>   
> 
> {noformat}
> For all project in my organisation I want to use branch br-1. However, after 
> I configure ivy, download the dependencies, build my project and I attempt to 
> publish it, I receive the following output:
> {noformat}
> :: publishing :: claudia.homeunix.net#hwlib
>   published hwlib to 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/br-1/1.0.part/hwlib.jar
>   published ivy to 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/br-1/1.0.part/ivy.xml
>   publish commited: moved 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0.part 
>   to /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0 
> {noformat}
> I use the latest from trunk updated today.
> As it can be seen the artifacts are published to the repository, but when 
> they are committed the branch is skipped from the URL - the directory 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0  does not exist at all.
> I traced the reason of this behaviour down to 
> FileSystemResolver.initTransaction(ModuleRevisionId module). There it 
> initializes from the artifact pattern defined in the settings file the 
> transaction's temporary directory and the transaction's destination 
> directory, respectively the String variables transactionTempDir and 
> transactionDestDir. The patterns are substituted using 
> IvyPatternHelper.substitute(String pattern, ModuleRevisionId moduleRevision) 
> and the problem lies in this method - it does not use the branch.
> I am submitting a patch of FileSystemResolver that uses 
> IvyPatternHelper.substitute(String pattern, String org, String module, String 
> branch, String revision, String artifact, String type, String ext, String 
> conf, ArtifactOrigin origin, Map extraAttributes)
> as this is the only method that uses the branch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (IVY-633) Packaging Data Parsed Incorrectly in Maven 2 POM

2008-05-05 Thread Chris Herron (JIRA)

[ 
https://issues.apache.org/jira/browse/IVY-633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594283#action_12594283
 ] 

Chris Herron commented on IVY-633:
--

Would really like to see this resolved. Spring-Security (formerly Acegi) is 
using bundle packaging and so is affected by this issue. As you know, Acegi is 
a hugely popular framework.

> Packaging Data Parsed Incorrectly in Maven 2 POM
> 
>
> Key: IVY-633
> URL: https://issues.apache.org/jira/browse/IVY-633
> Project: Ivy
>  Issue Type: Bug
>  Components: Maven Compatibility
>Affects Versions: 2.0.0-alpha-2
>Reporter: Luke Majewski
> Fix For: 2.0
>
>
> There is still an issue with some dependencies whose extension is not 
> specified in the default manner.  The example case is when trying to fetch 
> some camel JARs.
> When trying to get the camel-script-1.2.0 JAR, you see:
> [ivy:retrieve]   public: tried
> [ivy:retrieve]
> http://repo1.maven.org/maven2/org/apache/camel/camel-script/1.2.0/camel-script-1.2.0.bundle
> Ivy is trying to use the extension "bundle" and not JAR.  This is due to the 
> code fetching the extension from the  element of the POM.  The 
> relevant portion of the POM is here:
> 
> org.apache.camel
> camel-parent
>  1.2.0
> 
> camel-script
> bundle
> Camel :: Script
> Camel Script support
> Notice the bundle.  Looking at the POM XSD it seems 
> like this is a valid POM.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (IVY-814) Filesystem resolver does not work with branches

2008-05-05 Thread Antoine Levy-Lambert (JIRA)

[ 
https://issues.apache.org/jira/browse/IVY-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594245#action_12594245
 ] 

Antoine Levy-Lambert commented on IVY-814:
--

This is a blocker for our project to upgrade from 2.0.0-alpha2.

> Filesystem resolver does not work with branches
> ---
>
> Key: IVY-814
> URL: https://issues.apache.org/jira/browse/IVY-814
> Project: Ivy
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.0.0-beta-1, 2.0.0-beta-2, 2.0-RC1
> Environment: Found on Mac OS X, but  should be reproduced everywhere
>Reporter: Ivan "Rambius" Ivanov
> Attachments: FileSystemResolver.diff, IVY-814.zip
>
>
> I have the following settings file
> {noformat}
> 
>   
>   
>   
> 
>pattern="${repository.dir}/[organisation]/[module]/[branch]/[revision]/ivy.xml"/>
>pattern="${repository.dir}/[organisation]/[module]/[branch]/[revision]/[artifact].[ext]"/>
> 
>   
>   
> 
>   
> 
> {noformat}
> For all project in my organisation I want to use branch br-1. However, after 
> I configure ivy, download the dependencies, build my project and I attempt to 
> publish it, I receive the following output:
> {noformat}
> :: publishing :: claudia.homeunix.net#hwlib
>   published hwlib to 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/br-1/1.0.part/hwlib.jar
>   published ivy to 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/br-1/1.0.part/ivy.xml
>   publish commited: moved 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0.part 
>   to /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0 
> {noformat}
> I use the latest from trunk updated today.
> As it can be seen the artifacts are published to the repository, but when 
> they are committed the branch is skipped from the URL - the directory 
> /Users/rambus/.ivyrepo/claudia.homeunix.net/hwlib/1.0  does not exist at all.
> I traced the reason of this behaviour down to 
> FileSystemResolver.initTransaction(ModuleRevisionId module). There it 
> initializes from the artifact pattern defined in the settings file the 
> transaction's temporary directory and the transaction's destination 
> directory, respectively the String variables transactionTempDir and 
> transactionDestDir. The patterns are substituted using 
> IvyPatternHelper.substitute(String pattern, ModuleRevisionId moduleRevision) 
> and the problem lies in this method - it does not use the branch.
> I am submitting a patch of FileSystemResolver that uses 
> IvyPatternHelper.substitute(String pattern, String org, String module, String 
> branch, String revision, String artifact, String type, String ext, String 
> conf, ArtifactOrigin origin, Map extraAttributes)
> as this is the only method that uses the branch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.