ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r1326424 - in /ant/ivy/core/branches/2.3.x: ./ doc/ doc/images/ doc/osgi/ doc/samples/eclipse-plugin/ doc/use/ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/ src/java/org/apache/ivy/core/retrieve/ src/java/org/apache/ivy/core/se...
Date Sun, 15 Apr 2012 21:01:44 GMT
Author: maartenc
Date: Sun Apr 15 21:01:43 2012
New Revision: 1326424

URL: http://svn.apache.org/viewvc?rev=1326424&view=rev
Log:
Merged latest changes from trunk.

Added:
    ant/ivy/core/branches/2.3.x/doc/images/warning.png
      - copied unchanged from r1326422, ant/ivy/core/trunk/doc/images/warning.png
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java
      - copied unchanged from r1326422, ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
      - copied unchanged from r1326422, ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
    ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/core/OsgiLatestStrategyTest.java
      - copied unchanged from r1326422, ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/core/OsgiLatestStrategyTest.java
Removed:
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/OsgiRevisionStrategy.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/RepoDescriptorBasedResolver.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/ArtifactTokens.java
    ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/core/OsgiRevisionStrategyTest.java
    ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/util/ArtifactTokensTest.java
Modified:
    ant/ivy/core/branches/2.3.x/   (props changed)
    ant/ivy/core/branches/2.3.x/CHANGES.txt
    ant/ivy/core/branches/2.3.x/doc/concept.html
    ant/ivy/core/branches/2.3.x/doc/osgi.html
    ant/ivy/core/branches/2.3.x/doc/osgi/eclipse-plugin.html
    ant/ivy/core/branches/2.3.x/doc/osgi/osgi-mapping.html
    ant/ivy/core/branches/2.3.x/doc/osgi/standard-osgi.html
    ant/ivy/core/branches/2.3.x/doc/osgi/target-platform.html
    ant/ivy/core/branches/2.3.x/doc/samples/eclipse-plugin/ivy.xml
    ant/ivy/core/branches/2.3.x/doc/use/retrieve.html
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/ConvertManifestTask.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/IvyRetrieve.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/IvyPatternHelper.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/settings/IvySettings.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/ManifestParser.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/OBRResolver.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/RequirementAdapter.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolver.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/Version.java
    ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/VersionRange.java
    ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/obr/OBRResolverTest.java
    ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolverTest.java
    ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/util/VersionTest.java

Propchange: ant/ivy/core/branches/2.3.x/
------------------------------------------------------------------------------
  Merged /ant/ivy/core/trunk:r1324865-1326422

Modified: ant/ivy/core/branches/2.3.x/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/CHANGES.txt?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/CHANGES.txt (original)
+++ ant/ivy/core/branches/2.3.x/CHANGES.txt Sun Apr 15 21:01:43 2012
@@ -131,6 +131,7 @@ for detailed view of each issue, please 
 - DOCUMENTATION: wrong default resolver documented on the 'How does it work' page (IVY-1265)
 - DOCUMENTATION: Correct outdated links to configuration pages (IVY-1266)
 
+- NEW: [orgPath] can now be used as token in ivy/artifact patterns
 - NEW: New Ant datatype ivy:resources, an Ant resource collection like ivy:cachepath or ivy:cachefileset (IVY-334)
 - NEW: ivy:resolve and post resole task can now have inlined dependencies declaration.
 - NEW: Import Bushel into Ivy core (IVY-1241)
@@ -144,7 +145,6 @@ for detailed view of each issue, please 
 - IMPROVEMENT: ivy:makepom child element dependency should support the type and classifier attributes (IVY-1262)
 - IMPROVEMENT: ivy:retrieve can now create a path or fileset containing the retrieved artifacts (IVY-1235)
 - IMPROVEMENT: Improve diagnostics in ssh resolver (IVY-1267) (thanks to Stepan Koltsov)
-- IMPROVEMENT: ivy:retrieve can now convert 'dotted'-organisation names into a directory tree.
 - IMPROVEMENT: ivy:retrieve now accepts a nested mapper type.
 
 - FIX: Exclude doesn't work when there is some circular dependencies (IVY-1309)

Modified: ant/ivy/core/branches/2.3.x/doc/concept.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/doc/concept.html?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/doc/concept.html (original)
+++ ant/ivy/core/branches/2.3.x/doc/concept.html Sun Apr 15 21:01:43 2012
@@ -94,6 +94,7 @@ The tokens available depends on where th
 But here are all the tokens currently available:
 <ul>
 <li>[organisation]</li> the organisation name
+<li>[orgPath] <span class="since">(since 2.3)</span></li> the organisation name where '.' has been replaced by '/'. This can be used to configure maven2-like repositories. 
 <li>[module]</li> the module name
 <li>[branch]</li> the branch name
 <li>[revision]</li> the revision name

Modified: ant/ivy/core/branches/2.3.x/doc/osgi.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/doc/osgi.html?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/doc/osgi.html (original)
+++ ant/ivy/core/branches/2.3.x/doc/osgi.html Sun Apr 15 21:01:43 2012
@@ -28,9 +28,14 @@
 
 Since Apache Ivy&#153; 2.3, some support for OSGi&#153; dependency management has been introduced.
 
-<div class="notice">
+<table class="notice">
+  <tr>
+    <td style="vertical-align: top"><img src="images/warning.png" style="float:left;" /></td>
+    <td>
     Note that this feature is considered as <b>experimental</b>. It should work with simple configuration but may not in complex ones. If you have any issue with that feature, you are welcomed to come discussed your use case on the <a href="http://ant.apache.org/ivy/mailing-lists.html">ivy-user</a> mailing list, or discuss about implementation issues or improvement you may have found on <a href="http://ant.apache.org/ivy/mailing-lists.html">ant-dev</a>.
-</div>
+    </td>
+  </tr>
+</table>
 
 So with a standard ivy.xml, you can express some dependency on some OSGi bundle and every of their trasitive dependencies will be resolved. You can also declare in your ivy.xml some OSGi dependency, like a <tt>Require-Bundle</tt>, an <tt>Import-Package</tt> or an <tt>Import-Service</tt>, miming an OSGi MANIFEST.MF.
 

Modified: ant/ivy/core/branches/2.3.x/doc/osgi/eclipse-plugin.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/doc/osgi/eclipse-plugin.html?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/doc/osgi/eclipse-plugin.html (original)
+++ ant/ivy/core/branches/2.3.x/doc/osgi/eclipse-plugin.html Sun Apr 15 21:01:43 2012
@@ -26,9 +26,14 @@
 <body>
 	<textarea id="xooki-source">
 
-<div class="notice">
-This documentation is describing the <b>experimental</b> OSGi capability of Ivy. It should work with simple configuration but may not in complex ones. If you have any issue with that feature, you are welcomed to come discussed your use case on the <a href="http://ant.apache.org/ivy/mailing-lists.html">ivy-user</a> mailing list, or discuss about implementation issues or improvement you may have found on <a href="http://ant.apache.org/ivy/mailing-lists.html">ant-dev</a>.
-</div>
+<table class="notice">
+  <tr>
+    <td style="vertical-align: top"><img src="../images/warning.png" style="float:left;" /></td>
+    <td>
+    Note that this feature is considered as <b>experimental</b>. It should work with simple configuration but may not in complex ones. If you have any issue with that feature, you are welcomed to come discussed your use case on the <a href="http://ant.apache.org/ivy/mailing-lists.html">ivy-user</a> mailing list, or discuss about implementation issues or improvement you may have found on <a href="http://ant.apache.org/ivy/mailing-lists.html">ant-dev</a>.
+    </td>
+  </tr>
+</table>
 
 This page describes how to build an Eclipse&#153; plugin with Apache Ivy&#153; and its OSGi&#153; capabilities.
 
@@ -39,6 +44,7 @@ In few steps, we will setup a build to c
 <ol>
 <li>download this <a href="../samples/eclipse-plugin/ivy.xml">ivy.xml<a>, this <a href="../samples/eclipse-plugin/ivysettings.xml">ivysettings.xml</a>, this <a href="../samples/eclipse-plugin/ivysettings.properties">ivysettings.properties</a>, this <a href="../samples/eclipse-plugin/build.xml">build.xml</a>, and put them into your plugin folder;</li>
 <li>in the ivysettings.properties, specify the location of the plugins folder of your Eclipse target;</li>
+<li>in the ivy.xml, change the symbolic name declared in the extends element;</li>
 <li><i>(optional)</i> by default the build.xml is expecting the sources to be in the <tt>src</tt> folder. You may want to edit it if it is not the case</li>
 <li><i>(optional)</i> if Ivy is not in Ant's classpath, get the jar of <a href="../download.html">Apache Ivy</a> and edit the build.xml accordingly (see the comments at the begining of the file)</li>
 </ol>

Modified: ant/ivy/core/branches/2.3.x/doc/osgi/osgi-mapping.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/doc/osgi/osgi-mapping.html?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/doc/osgi/osgi-mapping.html (original)
+++ ant/ivy/core/branches/2.3.x/doc/osgi/osgi-mapping.html Sun Apr 15 21:01:43 2012
@@ -36,9 +36,8 @@ In OSGi a bundle is identified by its sy
 
 The choosen mapping is:
 <ul>
-<li>No organisation : org=""</li>
+<li>The organisation is "bundle" (transitive dependencies like pakages or services have their own organisations, "package" and "service")</li>
 <li>The module name is the symbolic name</li>
-<li>an extra attribute is defining it as an OSGi bundle</li>
 </ul>
 
 <table border="1" cellspacing="1" cellpadding="4">
@@ -50,7 +49,7 @@ The choosen mapping is:
 <td> <tt>Bundle-SymbolicName: com.acme.product.plugin</tt> </td>
 <td>
 <code type="xml">
-<info organisation="" module="com.acme.product.plugin" osgi="bundle" />
+<info organisation="bundle" module="com.acme.product.plugin" />
 </code>
 </td>
 </tr>
@@ -75,7 +74,7 @@ Then about version range, Ivy will under
 <td><tt>Require-Bundle: com.acme.product.plugin;bundle-version="3.2.1"</tt> </td>
 <td>
 <code type="xml">
-<dependency osgi="bundle" org="" name="com.acme.product.plugin" rev="[3.2.1,)" />
+<dependency org="bundle" name="com.acme.product.plugin" rev="[3.2.1,)" />
 </code>
 </td>
 </tr>
@@ -159,7 +158,7 @@ If there is the OSGi <tt>resolution</tt>
 <td> <tt>Require-Bundle: com.acme.product.plugin;bundle-version="3.2.1";resolution:="optional"</tt> </td>
 <td>
 <code type="xml">
-<dependency osgi="bundle" org="" name="com.acme.product.plugin" rev="[3.2.1,)" conf="optional->default;transitive-optional->transitive-optional" />
+<dependency org="bundle" name="com.acme.product.plugin" rev="[3.2.1,)" conf="optional->default;transitive-optional->transitive-optional" />
 </code>
 </td>
 </tr>
@@ -183,7 +182,7 @@ As it is an import package the configura
 </td>
 <td>
 <code type="xml">
-<dependency osgi="pkg" org="" name="com.acme.product.plugin.utils" rev="[3.2.1,)" conf="default->default;use_com.acme.product.plugin.utils->use_com.acme.product.plugin.utils" />
+<dependency org="package" name="com.acme.product.plugin.utils" rev="[3.2.1,)" conf="default->default;use_com.acme.product.plugin.utils->use_com.acme.product.plugin.utils" />
 </code>
 </td>
 </tr>
@@ -191,7 +190,7 @@ As it is an import package the configura
 <td> <tt>Import-Package: com.acme.product.plugin.utils;version="3.2.1";resolution:="optional"</tt> </td>
 <td>
  <code type="xml">
-<dependency osgi="pkg" org="" name="com.acme.product.plugin.utils" rev="[3.2.1,)" conf="optional->default;transitive-optional->transitive-optional;use_com.acme.product.plugin.utils->use_com.acme.product.plugin.utils" />
+<dependency org="package" name="com.acme.product.plugin.utils" rev="[3.2.1,)" conf="optional->default;transitive-optional->transitive-optional;use_com.acme.product.plugin.utils->use_com.acme.product.plugin.utils" />
 </code>
 </td>
 </tr>
@@ -211,9 +210,9 @@ The OSGi <tt>Bundle-RequiredExecutionEnv
 <td>
 <code type="xml">
 <dependencies>
-    <exclude org="" module="javax.accessibility" osgi="pkg" />
-    <exclude org="" module="javax.activation" osgi="pkg" />
-    <exclude org="" module="javax.activity" osgi="pkg" />
+    <exclude org="package" module="javax.accessibility" />
+    <exclude org="package" module="javax.activation" />
+    <exclude org="package" module="javax.activity" />
     ...
 </dependencies>
 </code>

Modified: ant/ivy/core/branches/2.3.x/doc/osgi/standard-osgi.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/doc/osgi/standard-osgi.html?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/doc/osgi/standard-osgi.html (original)
+++ ant/ivy/core/branches/2.3.x/doc/osgi/standard-osgi.html Sun Apr 15 21:01:43 2012
@@ -26,9 +26,18 @@
 <body>
 	<textarea id="xooki-source">
 
-<div class="notice">
-This documentation is describing the <b>experimental</b> OSGi capability of Ivy. It should work with simple configuration but may not in complex ones. If you have any issue with that feature, you are welcomed to come discussed your use case on the <a href="http://ant.apache.org/ivy/mailing-lists.html">ivy-user</a> mailing list, or discuss about implementation issues or improvement you may have found on <a href="http://ant.apache.org/ivy/mailing-lists.html">ant-dev</a>.
-</div>
+<table class="notice">
+  <tr>
+    <td style="vertical-align: top"><img src="../images/warning.png" style="float:left;" /></td>
+    <td>
+    Note that this feature is considered as <b>experimental</b>. It should work with simple configuration but may not in complex ones. If you have any issue with that feature, you are welcomed to come discussed your use case on the <a href="http://ant.apache.org/ivy/mailing-lists.html">ivy-user</a> mailing list, or discuss about implementation issues or improvement you may have found on <a href="http://ant.apache.org/ivy/mailing-lists.html">ant-dev</a>.
+    </td>
+  </tr>
+</table>
+
+<hr />
+<center><b>TODO - WORK IN PROGRESS</b></center>
+<hr />
 
 This page describes how to build an OSGi&#153; bundle with Apache Ivy&#153;. In this use case, we just basically want to compute a classpath to compile, optionaly one for testing too, and then publish our bundle in a OSGi aware repository.
 
@@ -46,7 +55,6 @@ In few steps, we will setup a build to c
 <li><i>(optional)</i> if Ivy is not in Ant's classpath, get the jar of <a href="../download.html">Apache Ivy</a> and edit the build.xml accordingly (see the comments at the begining of the file)</li>
 </ol>
 
-
 	</textarea>
 <script type="text/javascript">xooki.postProcess();</script>
 </body>

Modified: ant/ivy/core/branches/2.3.x/doc/osgi/target-platform.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/doc/osgi/target-platform.html?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/doc/osgi/target-platform.html (original)
+++ ant/ivy/core/branches/2.3.x/doc/osgi/target-platform.html Sun Apr 15 21:01:43 2012
@@ -26,13 +26,26 @@
 <body>
 	<textarea id="xooki-source">
 
-<div class="notice">
-This documentation is describing the <b>experimental</b> OSGi capability of Ivy. It should work with simple configuration but may not in complex ones. If you have any issue with that feature, you are welcomed to come discussed your use case on the <a href="http://ant.apache.org/ivy/mailing-lists.html">ivy-user</a> mailing list, or discuss about implementation issues or improvement you may have found on <a href="http://ant.apache.org/ivy/mailing-lists.html">ant-dev</a>.
-</div>
+<table class="notice">
+  <tr>
+    <td style="vertical-align: top"><img src="../images/warning.png" style="float:left;" /></td>
+    <td>
+    Note that this feature is considered as <b>experimental</b>. It should work with simple configuration but may not in complex ones. If you have any issue with that feature, you are welcomed to come discussed your use case on the <a href="http://ant.apache.org/ivy/mailing-lists.html">ivy-user</a> mailing list, or discuss about implementation issues or improvement you may have found on <a href="http://ant.apache.org/ivy/mailing-lists.html">ant-dev</a>.
+    </td>
+  </tr>
+</table>
 
-Building an OSGi&#153; bundle with standard tools like <tt>javac</tt> and a classpath computed by Apache Ivy&#153; can be erroneous as these tools doesn't take into account the package visibility enforced by the OSGi metadata. Then switching to OSGi dedicated tools like the Eclipse&#153; JTD can be prefered. This kind of tools still need a "target platform", a set of jars against to compile and then later run. A target platform can be easily managed with Ivy and its OSGi capabilities.
+<hr />
+<center><b>TODO - WORK IN PROGRESS</b></center>
+<hr />
 
-TODO
+Building an OSGi&#153; bundle with standard tools like <tt>javac</tt> and a classpath computed by Apache Ivy&#153; can be erroneous as these tools doesn't take into account the package visibility enforced by the OSGi metadata. Then switching to OSGi dedicated tools like the Eclipse&#153; JDT can be prefered. This kind of tools still need a "target platform", a set of jars against to compile and then later run. A target platform can be easily managed with Ivy and its OSGi capabilities.
+
+<ul>Some links of interest:
+  <li><a href="../resolver/obr.html">OSGi Bundle Repository Resolver</a></li>
+  <li><a href="../resolver/updatesite.html">Eclipse updatesite Resolver</a></li>
+  <li><a href="../use/retrieve.html">Ant ivy:retrieve task</a></li>
+</ul>
 
 	</textarea>
 <script type="text/javascript">xooki.postProcess();</script>

Modified: ant/ivy/core/branches/2.3.x/doc/samples/eclipse-plugin/ivy.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/doc/samples/eclipse-plugin/ivy.xml?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/doc/samples/eclipse-plugin/ivy.xml (original)
+++ ant/ivy/core/branches/2.3.x/doc/samples/eclipse-plugin/ivy.xml Sun Apr 15 21:01:43 2012
@@ -18,8 +18,8 @@
    under the License.    
 -->
 <ivy-module version="2.2" xmlns:o="http://ant.apache.org/ivy/osgi">
-    <info organisation="" module="myplugin">
-        <extends organisation="" module="myplugin" revision="1.0.0.qualifier" location="META-INF/MANIFEST.MF" />
+    <info organisation="bundle" module="myplugin">
+        <extends organisation="bundle" module="com.acme.myplugin" revision="1.0.0.qualifier" location="META-INF/MANIFEST.MF" />
     </info>
     <configurations>
         <conf name="compile"  extends="default,embedded" description="Dependencies for the compilation" />
@@ -32,8 +32,8 @@
         <!-- example of a dependency that we can't declare in the MANIFEST.MF because we want it to be embedded -->
         <!--dependency osgi="bundle" org="" module="org.apache.commons.httpcore" rev="4.1.0" conf="embedded->default" /-->
         <!-- Ivy-Osgi doesn't understand bundle fragment -->
-        <dependency o:type="bundle" org="" name="org.eclipse.swt.win32.win32.x86" rev="3.+" conf="win32->default" />
-        <dependency o:type="bundle" org="" name="org.eclipse.swt.cocoa.macosx.x86_64" rev="3.+" conf="macos->default" />
-        <dependency o:type="bundle" org="" name="org.eclipse.swt.gtk.linux.x86" rev="3.+" conf="linux->default" />
+        <dependency org="bundle" name="org.eclipse.swt.win32.win32.x86" rev="3.+" conf="win32->default" />
+        <dependency org="bundle" name="org.eclipse.swt.cocoa.macosx.x86_64" rev="3.+" conf="macos->default" />
+        <dependency org="bundle" name="org.eclipse.swt.gtk.linux.x86" rev="3.+" conf="linux->default" />
      </dependencies>
 </ivy-module>

Modified: ant/ivy/core/branches/2.3.x/doc/use/retrieve.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/doc/use/retrieve.html?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/doc/use/retrieve.html (original)
+++ ant/ivy/core/branches/2.3.x/doc/use/retrieve.html Sun Apr 15 21:01:43 2012
@@ -62,11 +62,6 @@ Possible values are:
 <li><b>always</b></li> always overwrite the destination file
 <li><b>never</b></li> never overwrite the destination file
 </ul></td><td>No. Defaults to 'newer'.</td></tr>
-    <tr><td>dirMode</td><td>option to configure how the [organisation] token in the patterns will be replaced <span class="since">(since 2.3)</span>.
-Possible values are:
-<ul><li><b>flat</b> (default)</li> don't convert the organisation name, the token will get exactly the same value as the organisation
-<li><b>tree</b></li> replace the '.' within the organisation name with '/'
-</ul>See the examples below.</td><td>No. Defaults to 'flat'.</td></tr>
     <tr><td>symlink</td><td>true to create symbolic links, false to copy the artifacts. The destination of the symbolic links depends on the value of the useOrigin attribute <span class="since">(since 2.0)</span></td><td>No. Defaults to false</td></tr>
     <tr><td>settingsRef</td><td>A reference to the ivy settings that must be used by this task <span class="since">(since 2.0)</span></td><td>No, 'ivy.instance' is taken by default.</td></tr></tbody>
     <tr><td>log</td><td>the log setting to use during the resolve and retrieve process. <span class="since">(since 2.0)</span><br/>
@@ -142,7 +137,7 @@ lib
 
 <hr/>
 <code type="xml">
-<ivy:retrieve pattern="${lib.dir}/[organisation]/[artifact]-[revision].[ext]" dirMode="flat"/>
+<ivy:retrieve pattern="${lib.dir}/[organisation]/[artifact]-[revision].[ext]" />
 </code>
 Retrieves all dependencies of the last resolve call to a lib directory. The [organisation] token will get the unmodified organisation value. The resulting lib dir could look like this:
 <code>
@@ -155,9 +150,9 @@ lib
 </code>
 
 <code type="xml">
-<ivy:retrieve pattern="${lib.dir}/[organisation]/[artifact]-[revision].[ext]" dirMode="tree"/>
+<ivy:retrieve pattern="${lib.dir}/[orgPath]/[artifact]-[revision].[ext]" />
 </code>
-Retrieves all dependencies of the last resolve call to a lib directory. The [organisation] token will get a tree structure. The resulting lib dir could look like this:
+Retrieves all dependencies of the last resolve call to a lib directory. The [orgPath] token will get a tree structure. The resulting lib dir could look like this:
 <code>
 lib
   org

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/ConvertManifestTask.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/ConvertManifestTask.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/ConvertManifestTask.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/ConvertManifestTask.java Sun Apr 15 21:01:43 2012
@@ -30,6 +30,7 @@ import org.apache.ivy.osgi.core.BundleIn
 import org.apache.ivy.osgi.core.BundleInfoAdapter;
 import org.apache.ivy.osgi.core.ExecutionEnvironmentProfileProvider;
 import org.apache.ivy.osgi.core.ManifestParser;
+import org.apache.ivy.osgi.core.OSGiManifestParser;
 import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter;
 import org.apache.tools.ant.BuildException;
 
@@ -83,7 +84,8 @@ public class ConvertManifestTask extends
         } catch (ParseException e) {
             throw new BuildException("Incorrect manifest file '" + manifest + "'", e);
         }
-        ModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(null, bundleInfo, profileProvider);
+        ModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(
+            OSGiManifestParser.getInstance(), null, bundleInfo, profileProvider);
 
         try {
             XmlModuleDescriptorWriter.write(md, ivyFile);

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/IvyRetrieve.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/IvyRetrieve.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/IvyRetrieve.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/ant/IvyRetrieve.java Sun Apr 15 21:01:43 2012
@@ -43,10 +43,6 @@ public class IvyRetrieve extends IvyPost
             RetrieveOptions.OVERWRITEMODE_NEWER, RetrieveOptions.OVERWRITEMODE_DIFFERENT
     });
 
-    private static final Collection DIRMODE_VALUES = Arrays.asList(new String[] {
-            RetrieveOptions.DIRMODE_FLAT, RetrieveOptions.DIRMODE_TREE
-    });
-
     private String pattern;
 
     private String ivypattern = null;
@@ -57,8 +53,6 @@ public class IvyRetrieve extends IvyPost
     
     private String overwriteMode = RetrieveOptions.OVERWRITEMODE_NEWER;
 
-    private String dirMode = RetrieveOptions.DIRMODE_FLAT;
-
     private String pathId = null;
 
     private String setId = null;
@@ -110,7 +104,6 @@ public class IvyRetrieve extends IvyPost
                             .setArtifactFilter(artifactFilter)
                             .setSync(sync)
                             .setOverwriteMode(getOverwriteMode())
-                            .setDirMode(getDirMode())
                             .setUseOrigin(isUseOrigin())
                             .setMakeSymlinks(symlink)
                             .setResolveId(getResolveId())
@@ -187,18 +180,6 @@ public class IvyRetrieve extends IvyPost
         return overwriteMode;
     }
 
-    public void setDirMode(String dirMode) {
-        if (!DIRMODE_VALUES.contains(dirMode)) {
-            throw new IllegalArgumentException("invalid dirMode value '" + dirMode + "'. "
-                + "Valid values are " + DIRMODE_VALUES);
-        }
-        this.dirMode = dirMode;
-    }
-
-    public String getDirMode() {
-        return dirMode;
-    }
-    
     /**
      * Add a mapper to convert the file names.
      *

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/IvyPatternHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/IvyPatternHelper.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/IvyPatternHelper.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/IvyPatternHelper.java Sun Apr 15 21:01:43 2012
@@ -61,6 +61,8 @@ public final class IvyPatternHelper {
 
     public static final String ORGANISATION_KEY2 = "organization";
 
+    public static final String ORGANISATION_PATH_KEY = "orgPath";
+
     public static final String ORIGINAL_ARTIFACTNAME_KEY = "originalname";
 
     private static final Pattern PARAM_PATTERN = Pattern.compile("\\@\\{(.*?)\\}");
@@ -148,6 +150,7 @@ public final class IvyPatternHelper {
         }
         tokens.put(ORGANISATION_KEY, org == null ? "" : org);
         tokens.put(ORGANISATION_KEY2, org == null ? "" : org);
+        tokens.put(ORGANISATION_PATH_KEY, org == null ? "" : org.replace('.', '/'));
         tokens.put(MODULE_KEY, module == null ? "" : module);
         tokens.put(BRANCH_KEY, branch == null ? "" : branch);
         tokens.put(REVISION_KEY, revision == null ? "" : revision);
@@ -222,6 +225,10 @@ public final class IvyPatternHelper {
         if (tokensCopy.containsKey(ORGANISATION_KEY) && !tokensCopy.containsKey(ORGANISATION_KEY2)) {
             tokensCopy.put(ORGANISATION_KEY2, tokensCopy.get(ORGANISATION_KEY));
         }
+        if (tokensCopy.containsKey(ORGANISATION_KEY) && !tokensCopy.containsKey(ORGANISATION_PATH_KEY)) {
+            String org = (String) tokensCopy.get(ORGANISATION_KEY);
+            tokensCopy.put(ORGANISATION_PATH_KEY, org == null ? "" : org.replace('.', '/'));
+        }
         
         StringBuffer buffer = new StringBuffer();
 

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java Sun Apr 15 21:01:43 2012
@@ -313,21 +313,9 @@ public class RetrieveEngine {
                     continue; // skip this artifact, the filter didn't accept it!
                 }
 
-                String destFileName;
-                if (RetrieveOptions.DIRMODE_FLAT.equals(options.getDirMode())) {
-                    destFileName = IvyPatternHelper.substitute(destPattern,
+                String destFileName = IvyPatternHelper.substitute(destPattern,
                             artifact.getArtifact().getModuleRevisionId(), artifact.getArtifact(),
                             conf, artifact.getArtifactOrigin());
-                } else if (RetrieveOptions.DIRMODE_TREE.equals(options.getDirMode())) {
-                    ModuleRevisionId mRevId = artifact.getArtifact().getModuleRevisionId();
-                    String org = mRevId.getOrganisation() == null ? null : mRevId.getOrganisation().replace('.', '/');
-                    destFileName = IvyPatternHelper.substitute(destPattern, org, mRevId.getName(), mRevId.getBranch(),
-                            mRevId.getRevision(), artifact.getName(), artifact.getType(), artifact.getExt(), conf,
-                            artifact.getArtifactOrigin(), mrid.getQualifiedExtraAttributes(), artifact.getArtifact().getQualifiedExtraAttributes());
-                } else {
-                    throw new IllegalArgumentException("Unsupported dirMode: " + options.getDirMode());
-                }
-                
                 Set dest = (Set) artifactsToCopy.get(artifact);
                 if (dest == null) {
                     dest = new HashSet();

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java Sun Apr 15 21:01:43 2012
@@ -32,9 +32,6 @@ public class RetrieveOptions extends Log
     public static final String OVERWRITEMODE_NEWER = "newer";
     public static final String OVERWRITEMODE_DIFFERENT = "different";
 
-    public static final String DIRMODE_FLAT = "flat";
-    public static final String DIRMODE_TREE = "tree";
-    
     /**
      * The names of configurations to retrieve. If the array consists only of '*', then all
      * configurations of the module will be retrieved.
@@ -77,8 +74,6 @@ public class RetrieveOptions extends Log
      */
     private boolean makeSymlinks = false;
 
-    private String dirMode = DIRMODE_FLAT;
-
     /**
      * The id used to store the resolve information.
      */
@@ -99,7 +94,6 @@ public class RetrieveOptions extends Log
         this.overwriteMode = options.overwriteMode;
         this.useOrigin = options.useOrigin;
         this.makeSymlinks = options.makeSymlinks;
-        this.dirMode = options.dirMode;
         this.resolveId = options.resolveId;
         this.mapper = options.mapper;
     }
@@ -113,15 +107,6 @@ public class RetrieveOptions extends Log
         return this;
     }
 
-    public String getDirMode() {
-        return dirMode == null ? DIRMODE_FLAT : dirMode;
-    }
-
-    public RetrieveOptions setDirMode(String dirMode) {
-        this.dirMode = dirMode;
-        return this;
-    }
-
     public Filter getArtifactFilter() {
         return artifactFilter;
     }

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/core/settings/IvySettings.java Sun Apr 15 21:01:43 2012
@@ -59,7 +59,7 @@ import org.apache.ivy.core.resolve.Resol
 import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.retrieve.RetrieveEngineSettings;
 import org.apache.ivy.core.sort.SortEngineSettings;
-import org.apache.ivy.osgi.core.OsgiRevisionStrategy;
+import org.apache.ivy.osgi.core.OsgiLatestStrategy;
 import org.apache.ivy.plugins.IvySettingsAware;
 import org.apache.ivy.plugins.circular.CircularDependencyStrategy;
 import org.apache.ivy.plugins.circular.ErrorCircularDependencyStrategy;
@@ -248,12 +248,12 @@ public class IvySettings implements Sort
         LatestLexicographicStrategy latestLexicographicStrategy = new LatestLexicographicStrategy();
         LatestRevisionStrategy latestRevisionStrategy = new LatestRevisionStrategy();
         LatestTimeStrategy latestTimeStrategy = new LatestTimeStrategy();
-        OsgiRevisionStrategy osgiRevisionStrategy = new OsgiRevisionStrategy();
+        OsgiLatestStrategy osgiLatestStrategy = new OsgiLatestStrategy();
 
         addLatestStrategy("latest-revision", latestRevisionStrategy);
         addLatestStrategy("latest-lexico", latestLexicographicStrategy);
         addLatestStrategy("latest-time", latestTimeStrategy);
-        addLatestStrategy("latest-osgi", osgiRevisionStrategy);
+        addLatestStrategy("latest-osgi", osgiLatestStrategy);
 
         addLockStrategy("no-lock", new NoLockStrategy());
         addLockStrategy("artifact-lock", new ArtifactLockStrategy(debugLocking()));

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java Sun Apr 15 21:01:43 2012
@@ -22,12 +22,10 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import org.apache.ivy.Ivy;
@@ -45,6 +43,7 @@ import org.apache.ivy.osgi.util.Version;
 import org.apache.ivy.osgi.util.VersionRange;
 import org.apache.ivy.plugins.matcher.ExactOrRegexpPatternMatcher;
 import org.apache.ivy.plugins.matcher.PatternMatcher;
+import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
 
 public class BundleInfoAdapter {
 
@@ -66,16 +65,7 @@ public class BundleInfoAdapter {
 
     public static final String CONF_USE_PREFIX = "use_";
 
-    public static final String EXTRA_ATTRIBUTE_NAME = "o:type";
-
-    public static final Map/* <String, String> */OSGI_BUNDLE = Collections.singletonMap(
-        EXTRA_ATTRIBUTE_NAME, BundleInfo.BUNDLE_TYPE);
-
-    public static final Map/* <String, String> */OSGI_PACKAGE = Collections.singletonMap(
-        EXTRA_ATTRIBUTE_NAME, BundleInfo.PACKAGE_TYPE);
-
-    public static final Map/* <String, String> */OSGI_SERVICE = Collections.singletonMap(
-        EXTRA_ATTRIBUTE_NAME, BundleInfo.SERVICE_TYPE);
+    public static final String EXTRA_INFO_EXPORT_PREFIX = "_osgi_export_";
 
     /**
      * 
@@ -83,14 +73,15 @@ public class BundleInfoAdapter {
      *            uri to help build the absolute url if the bundle info has a relative uri.
      * @param bundle
      * @param profileProvider
+     * @param parser 
      * @return
      * @throws ProfileNotFoundException
      */
-    public static DefaultModuleDescriptor toModuleDescriptor(URI baseUri, BundleInfo bundle,
+    public static DefaultModuleDescriptor toModuleDescriptor(ModuleDescriptorParser parser, URI baseUri, BundleInfo bundle,
             ExecutionEnvironmentProfileProvider profileProvider) throws ProfileNotFoundException {
-        DefaultModuleDescriptor md = new DefaultModuleDescriptor(null, null);
+        DefaultModuleDescriptor md = new DefaultModuleDescriptor(parser, null);
         md.addExtraAttributeNamespace("o", Ivy.getIvyHomeURL() + "osgi");
-        ModuleRevisionId mrid = asMrid(bundle.getSymbolicName(), bundle.getVersion(), OSGI_BUNDLE);
+        ModuleRevisionId mrid = asMrid(BundleInfo.BUNDLE_TYPE, bundle.getSymbolicName(), bundle.getVersion());
         md.setResolvedPublicationDate(new Date());
         md.setModuleRevisionId(mrid);
 
@@ -102,6 +93,8 @@ public class BundleInfoAdapter {
         Iterator itExport = bundle.getExports().iterator();
         while (itExport.hasNext()) {
             ExportPackage exportPackage = (ExportPackage) itExport.next();
+            md.getExtraInfo().put(EXTRA_INFO_EXPORT_PREFIX + exportPackage.getName(),
+                exportPackage.getVersion().toString());
             exportedPkgNames.add(exportPackage.getName());
             String[] confDependencies = new String[exportPackage.getUses().size() + 1];
             int i = 0;
@@ -151,11 +144,11 @@ public class BundleInfoAdapter {
                 Iterator itPkg = profile.getPkgNames().iterator();
                 while (itPkg.hasNext()) {
                     String pkg = (String) itPkg.next();
-                    ArtifactId id = new ArtifactId(ModuleId.newInstance("", pkg),
+                    ArtifactId id = new ArtifactId(ModuleId.newInstance(BundleInfo.BUNDLE_TYPE, pkg),
                             PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION,
                             PatternMatcher.ANY_EXPRESSION);
                     DefaultExcludeRule rule = new DefaultExcludeRule(id,
-                            ExactOrRegexpPatternMatcher.INSTANCE, OSGI_PACKAGE);
+                            ExactOrRegexpPatternMatcher.INSTANCE, null);
                     String[] confs = md.getConfigurationsNames();
                     for (int i = 0; i < confs.length; i++) {
                         rule.addConfiguration(confs[i]);
@@ -288,8 +281,7 @@ public class BundleInfoAdapter {
                 continue;
             }
 
-            Map/* <String, String> */osgiAtt = Collections.singletonMap(EXTRA_ATTRIBUTE_NAME, type);
-            ModuleRevisionId ddmrid = asMrid(name, requirement.getVersion(), osgiAtt);
+            ModuleRevisionId ddmrid = asMrid(type, name, requirement.getVersion());
             DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(ddmrid, false);
 
             String conf = CONF_NAME_DEFAULT;
@@ -314,23 +306,18 @@ public class BundleInfoAdapter {
 
     }
 
-    private static ModuleRevisionId asMrid(String symbolicNAme, Version v,
-            Map/* <String, String> */extraAttr) {
-        return ModuleRevisionId.newInstance("", symbolicNAme, v == null ? null : v.toString(),
-            extraAttr);
+    public static ModuleRevisionId asMrid(String type, String name, Version v) {
+        return ModuleRevisionId.newInstance(type, name, v == null ? null : v.toString());
     }
 
-    private static ModuleRevisionId asMrid(String symbolicNAme, VersionRange v, Map/*
-                                                                                    * <String,
-                                                                                    * String>
-                                                                                    */extraAttr) {
+    public static ModuleRevisionId asMrid(String type, String name, VersionRange v) {
         String revision;
         if (v == null) {
             revision = "[0,)";
         } else {
             revision = v.toIvyRevision();
         }
-        return ModuleRevisionId.newInstance("", symbolicNAme, revision, extraAttr);
+        return ModuleRevisionId.newInstance(type, name, revision);
     }
 
     public static class ProfileNotFoundException extends RuntimeException {

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/ManifestParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/ManifestParser.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/ManifestParser.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/ManifestParser.java Sun Apr 15 21:01:43 2012
@@ -226,7 +226,7 @@ public class ManifestParser {
         return new VersionRange(v);
     }
 
-    private static Version versionOf(String v) throws NumberFormatException {
+    private static Version versionOf(String v) throws ParseException {
         if (v == null) {
             return null;
         }

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java Sun Apr 15 21:01:43 2012
@@ -68,7 +68,7 @@ public class OSGiManifestParser implemen
         } catch (URISyntaxException e) {
             throw new RuntimeException("Unsupported repository, resources names are not uris", e);
         }
-        return BundleInfoAdapter.toModuleDescriptor(null, bundleInfo, profileProvider);
+        return BundleInfoAdapter.toModuleDescriptor(this, null, bundleInfo, profileProvider);
     }
 
     public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/OBRResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/OBRResolver.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/OBRResolver.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/OBRResolver.java Sun Apr 15 21:01:43 2012
@@ -31,12 +31,12 @@ import org.apache.ivy.core.cache.CacheRe
 import org.apache.ivy.core.event.EventManager;
 import org.apache.ivy.core.report.ArtifactDownloadReport;
 import org.apache.ivy.osgi.obr.xml.OBRXMLParser;
-import org.apache.ivy.osgi.repo.RepoDescriptorBasedResolver;
+import org.apache.ivy.osgi.repo.AbstractOSGiResolver;
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.plugins.repository.url.URLResource;
 import org.xml.sax.SAXException;
 
-public class OBRResolver extends RepoDescriptorBasedResolver {
+public class OBRResolver extends AbstractOSGiResolver {
 
     private String repoXmlURL;
 

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java Sun Apr 15 21:01:43 2012
@@ -179,7 +179,7 @@ public class OBRXMLParser {
             Version version;
             try {
                 version = new Version(v);
-            } catch (NumberFormatException e) {
+            } catch (ParseException e) {
                 log(Message.MSG_ERR, "Incorrect resource version: " + v + ". The resource "
                         + symbolicname + " is then ignored.");
                 skip();

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/RequirementAdapter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/RequirementAdapter.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/RequirementAdapter.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/obr/xml/RequirementAdapter.java Sun Apr 15 21:01:43 2012
@@ -93,7 +93,7 @@ public class RequirementAdapter {
     }
 
     private void parseCompareFilter(CompareFilter compareFilter, boolean not)
-            throws UnsupportedFilterException {
+            throws UnsupportedFilterException, ParseException {
         String att = compareFilter.getLeftValue();
         if (BundleInfo.PACKAGE_TYPE.equals(att) || BundleInfo.BUNDLE_TYPE.equals(att)
                 || "symbolicname".equals(att) || BundleInfo.SERVICE_TYPE.equals(att)) {
@@ -116,6 +116,12 @@ public class RequirementAdapter {
             name = compareFilter.getRightValue();
         } else if ("version".equals(att)) {
             String v = compareFilter.getRightValue();
+            Version version;
+            try {
+                version = new Version(v);
+            } catch (ParseException e) {
+                throw new ParseException("Ill formed version: " + v, 0);
+            }
             Operator operator = compareFilter.getOperator();
             if (not) {
                 if (operator == Operator.EQUALS) {
@@ -136,37 +142,37 @@ public class RequirementAdapter {
                     throw new UnsupportedFilterException(
                             "Multiple version matching is not supported");
                 }
-                startVersion = new Version(v);
+                startVersion = version;
                 startExclusive = false;
-                endVersion = new Version(v);
+                endVersion = version;
                 endExclusive = false;
             } else if (operator == Operator.GREATER_OR_EQUAL) {
                 if (startVersion != null) {
                     throw new UnsupportedFilterException(
                             "Multiple version matching is not supported");
                 }
-                startVersion = new Version(v);
+                startVersion = version;
                 startExclusive = false;
             } else if (operator == Operator.GREATER_THAN) {
                 if (startVersion != null) {
                     throw new UnsupportedFilterException(
                             "Multiple version matching is not supported");
                 }
-                startVersion = new Version(v);
+                startVersion = version;
                 startExclusive = true;
             } else if (operator == Operator.LOWER_OR_EQUAL) {
                 if (endVersion != null) {
                     throw new UnsupportedFilterException(
                             "Multiple version matching is not supported");
                 }
-                endVersion = new Version(v);
+                endVersion = version;
                 endExclusive = false;
             } else if (operator == Operator.LOWER_THAN) {
                 if (endVersion != null) {
                     throw new UnsupportedFilterException(
                             "Multiple version matching is not supported");
                 }
-                endVersion = new Version(v);
+                endVersion = version;
                 endExclusive = true;
             }
         } else {

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java Sun Apr 15 21:01:43 2012
@@ -195,9 +195,15 @@ public class P2ArtifactParser implements
             });
         }
 
-        protected void handleAttributes(Attributes atts) {
+        protected void handleAttributes(Attributes atts) throws SAXException {
             String id = atts.getValue(ID);
-            Version version = new Version(atts.getValue(VERSION));
+            Version version;
+            try {
+                version = new Version(atts.getValue(VERSION));
+            } catch (ParseException e) {
+                throw new SAXException("Incorrect version attribute on artifact '" + id + "': "
+                        + atts.getValue(VERSION) + " (" + e.getMessage() + ")");
+            }
             String classifier = atts.getValue(CLASSIFIER);
 
             p2Artifact = new P2Artifact(id, version, classifier);

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java Sun Apr 15 21:01:43 2012
@@ -286,11 +286,16 @@ public class P2MetadataParser implements
 
         }
 
-        protected void handleAttributes(Attributes atts) {
+        protected void handleAttributes(Attributes atts) throws SAXException {
             String id = atts.getValue(ID);
-            Version version = new Version(atts.getValue(VERSION));
+            String version = atts.getValue(VERSION);
             // Boolean singleton = Boolean.valueOf(atts.getValue(SINGLETON));
-            bundleInfo = new BundleInfo(id, version);
+            try {
+                bundleInfo = new BundleInfo(id, new Version(version));
+            } catch (ParseException e) {
+                throw new SAXException("Incorrect version on bundle '" + id + "': " + version
+                        + " (" + e.getMessage() + ")");
+            }
         }
 
     }
@@ -394,10 +399,15 @@ public class P2MetadataParser implements
             super(PROVIDED);
         }
 
-        protected void handleAttributes(Attributes atts) {
+        protected void handleAttributes(Attributes atts) throws SAXException {
             namespace = atts.getValue(NAMESPACE);
             name = atts.getValue(NAME);
-            version = new Version(atts.getValue(VERSION));
+            try {
+                version = new Version(atts.getValue(VERSION));
+            } catch (ParseException e) {
+                throw new SAXException("Incorrect version on provided capability: " + version
+                        + " (" + e.getMessage() + ")");
+            }
         }
 
     }
@@ -536,11 +546,16 @@ public class P2MetadataParser implements
             super(ARTIFACT);
         }
 
-        protected void handleAttributes(Attributes atts) {
+        protected void handleAttributes(Attributes atts) throws SAXException {
             String id = atts.getValue(ID);
-            Version version = new Version(atts.getValue(VERSION));
+            String version = atts.getValue(VERSION);
             String classifier = atts.getValue(CLASSIFIER);
-            artifact = new P2Artifact(id, version, classifier);
+            try {
+                artifact = new P2Artifact(id, new Version(version), classifier);
+            } catch (ParseException e) {
+                throw new SAXException("Incorrect version on artifact '" + id + "': " + version
+                        + " (" + e.getMessage() + ")");
+            }
         }
 
     }

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/RepoDescriptor.java Sun Apr 15 21:01:43 2012
@@ -30,6 +30,7 @@ import org.apache.ivy.osgi.core.BundleCa
 import org.apache.ivy.osgi.core.BundleInfo;
 import org.apache.ivy.osgi.core.BundleInfoAdapter;
 import org.apache.ivy.osgi.core.ExecutionEnvironmentProfileProvider;
+import org.apache.ivy.osgi.core.OSGiManifestParser;
 import org.apache.ivy.util.Message;
 
 public class RepoDescriptor {
@@ -96,8 +97,8 @@ public class RepoDescriptor {
     }
 
     public void addBundle(BundleInfo bundleInfo) {
-        DefaultModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(baseUri, bundleInfo,
-            profileProvider);
+        DefaultModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(
+            OSGiManifestParser.getInstance(), baseUri, bundleInfo, profileProvider);
         add(BundleInfo.BUNDLE_TYPE, bundleInfo.getSymbolicName(), md);
         Iterator itCapability = bundleInfo.getCapabilities().iterator();
         while (itCapability.hasNext()) {

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolver.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolver.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolver.java Sun Apr 15 21:01:43 2012
@@ -23,10 +23,10 @@ import java.net.URISyntaxException;
 import java.text.ParseException;
 
 import org.apache.ivy.core.cache.CacheResourceOptions;
-import org.apache.ivy.osgi.repo.RepoDescriptorBasedResolver;
+import org.apache.ivy.osgi.repo.AbstractOSGiResolver;
 import org.xml.sax.SAXException;
 
-public class UpdateSiteResolver extends RepoDescriptorBasedResolver {
+public class UpdateSiteResolver extends AbstractOSGiResolver {
 
     private String url;
 

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java Sun Apr 15 21:01:43 2012
@@ -177,7 +177,14 @@ public class EclipseUpdateSiteParser {
         }
 
         protected void handleAttributes(Attributes atts) throws SAXException {
-            feature = new EclipseFeature(atts.getValue(ID), new Version(atts.getValue(VERSION)));
+            String id = atts.getValue(ID);
+            String version = atts.getValue(VERSION);
+            try {
+                feature = new EclipseFeature(id, new Version(version));
+            } catch (ParseException e) {
+                throw new SAXException("Incorrect version on the feature '" + id + "': " + version
+                        + " (" + e.getMessage() + ")");
+            }
 
             String url = atts.getValue(URL);
             if (url != null) {

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java Sun Apr 15 21:01:43 2012
@@ -116,7 +116,14 @@ public class FeatureParser {
         }
 
         protected void handleAttributes(Attributes atts) throws SAXException {
-            feature = new EclipseFeature(atts.getValue(ID), new Version(atts.getValue(VERSION)));
+            String id = atts.getValue(ID);
+            String version = atts.getValue(VERSION);
+            try {
+                feature = new EclipseFeature(id, new Version(version));
+            } catch (ParseException e) {
+                throw new SAXException("Incorrect version on feature '" + id + "': " + version
+                        + " (" + e.getMessage() + ")");
+            }
 
             feature.setOS(atts.getValue(OS));
             feature.setWS(atts.getValue(WS));
@@ -157,8 +164,16 @@ public class FeatureParser {
         protected void handleAttributes(Attributes atts) throws SAXException {
             plugin = new EclipsePlugin();
 
-            plugin.setId(atts.getValue(ID));
-            plugin.setVersion(new Version(atts.getValue(VERSION)));
+            String id = atts.getValue(ID);
+            String version = atts.getValue(VERSION);
+
+            plugin.setId(id);
+            try {
+                plugin.setVersion(new Version(version));
+            } catch (ParseException e) {
+                throw new SAXException("Incorrect version on feature's plugin '" + id + "': "
+                        + version + " (" + e.getMessage() + ")");
+            }
             plugin.setUnpack(Boolean.valueOf(atts.getValue(UNPACK)).booleanValue());
             plugin.setFragment(atts.getValue(FRAGMENT));
             plugin.setFilter(atts.getValue(FILTER));
@@ -253,9 +268,16 @@ public class FeatureParser {
         protected void handleAttributes(Attributes atts) throws SAXException {
             require = new Require();
 
+            String version = atts.getValue(VERSION);
+
             require.setFeature(atts.getValue(FEATURE));
             require.setPlugin(atts.getValue(PLUGIN));
-            require.setVersion(new Version(atts.getValue(VERSION)));
+            try {
+                require.setVersion(new Version(version));
+            } catch (ParseException e) {
+                throw new SAXException("Incorrect version on feature's import: " + version + " ("
+                        + e.getMessage() + ")");
+            }
             require.setMatch(atts.getValue(MATCH));
             require.setFilter(atts.getValue(FILTER));
         }

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/Version.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/Version.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/Version.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/Version.java Sun Apr 15 21:01:43 2012
@@ -17,6 +17,8 @@
  */
 package org.apache.ivy.osgi.util;
 
+import java.text.ParseException;
+
 /**
  * Provides OSGi version support.
  */
@@ -30,16 +32,31 @@ public class Version implements Comparab
 
     private final String qualifier;
 
-    public Version(String versionStr, String qualifier) throws NumberFormatException {
+    public Version(String versionStr, String qualifier) throws ParseException {
         this(versionStr + "." + (qualifier != null ? qualifier : ""));
     }
 
-    public Version(String versionStr) throws NumberFormatException {
-        final String[] tmp = versionStr.split("[\\.]");
-        major = Integer.parseInt(tmp[0]);
-        minor = tmp.length >= 2 ? Integer.parseInt(tmp[1]) : 0;
-        patch = tmp.length >= 3 ? Integer.parseInt(tmp[2]) : 0;
-        qualifier = tmp.length == 4 ? tmp[3] : null;
+    public Version(String versionStr) throws ParseException {
+        String[] splits = versionStr.split("\\.");
+        if (splits == null || splits.length == 0 || splits.length > 4) {
+            throw new ParseException("Ill formed OSGi version", 0);
+        }
+        try {
+            major = Integer.parseInt(splits[0]);
+        } catch (NumberFormatException e) {
+            throw new ParseException("Major part of an OSGi version should be an integer", 0);
+        }
+        try {
+            minor = splits.length >= 2 ? Integer.parseInt(splits[1]) : 0;
+        } catch (NumberFormatException e) {
+            throw new ParseException("Minor part of an OSGi version should be an integer", 0);
+        }
+        try {
+            patch = splits.length >= 3 ? Integer.parseInt(splits[2]) : 0;
+        } catch (NumberFormatException e) {
+            throw new ParseException("Patch part of an OSGi version should be an integer", 0);
+        }
+        qualifier = splits.length == 4 ? splits[3] : null;
     }
 
     public Version(int major, int minor, int patch, String qualifier) {
@@ -49,6 +66,20 @@ public class Version implements Comparab
         this.qualifier = qualifier;
     }
 
+    /**
+     * Build a version from another one while appending an extra qualifier
+     * 
+     * @param baseVersion
+     * @param qualifier
+     */
+    public Version(Version baseVersion, String extraQualifier) {
+        this.major = baseVersion.major;
+        this.minor = baseVersion.minor;
+        this.patch = baseVersion.patch;
+        this.qualifier = baseVersion.qualifier == null ? extraQualifier
+                : (baseVersion.qualifier + extraQualifier);
+    }
+
     public String toString() {
         return numbersAsString() + (qualifier == null ? "" : "." + qualifier);
     }

Modified: ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/VersionRange.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/VersionRange.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/VersionRange.java (original)
+++ ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/util/VersionRange.java Sun Apr 15 21:01:43 2012
@@ -306,7 +306,7 @@ public class VersionRange {
         return startVersion.equals(endVersion);
     }
 
-    public boolean contains(String versionStr) {
+    public boolean contains(String versionStr) throws ParseException {
         return contains(new Version(versionStr));
     }
 

Modified: ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/obr/OBRResolverTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/obr/OBRResolverTest.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/obr/OBRResolverTest.java (original)
+++ ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/obr/OBRResolverTest.java Sun Apr 15 21:01:43 2012
@@ -48,34 +48,35 @@ import org.apache.ivy.core.settings.IvyS
 import org.apache.ivy.osgi.core.BundleInfo;
 import org.apache.ivy.osgi.core.BundleInfoAdapter;
 import org.apache.ivy.osgi.core.ManifestParser;
-import org.apache.ivy.osgi.repo.RepoDescriptorBasedResolver.RequirementStrategy;
+import org.apache.ivy.osgi.core.OSGiManifestParser;
+import org.apache.ivy.osgi.repo.AbstractOSGiResolver.RequirementStrategy;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 import org.apache.ivy.plugins.resolver.DualResolver;
 import org.apache.ivy.plugins.resolver.FileSystemResolver;
 
 public class OBRResolverTest extends TestCase {
 
-    private static final ModuleRevisionId MRID_TEST_BUNDLE = ModuleRevisionId.newInstance("",
-        "org.apache.ivy.osgi.testbundle", "1.2.3", BundleInfoAdapter.OSGI_BUNDLE);
+    private static final ModuleRevisionId MRID_TEST_BUNDLE = ModuleRevisionId.newInstance(
+        BundleInfo.BUNDLE_TYPE, "org.apache.ivy.osgi.testbundle", "1.2.3");
 
     private static final ModuleRevisionId MRID_TEST_BUNDLE_IMPORTING = ModuleRevisionId
-            .newInstance("", "org.apache.ivy.osgi.testbundle.importing", "3.2.1",
-                BundleInfoAdapter.OSGI_BUNDLE);
+            .newInstance(BundleInfo.BUNDLE_TYPE, "org.apache.ivy.osgi.testbundle.importing",
+                "3.2.1");
 
     private static final ModuleRevisionId MRID_TEST_BUNDLE_IMPORTING_VERSION = ModuleRevisionId
-            .newInstance("", "org.apache.ivy.osgi.testbundle.importing.version", "3.2.1",
-                BundleInfoAdapter.OSGI_BUNDLE);
+            .newInstance(BundleInfo.BUNDLE_TYPE,
+                "org.apache.ivy.osgi.testbundle.importing.version", "3.2.1");
 
     private static final ModuleRevisionId MRID_TEST_BUNDLE_IMPORTING_OPTIONAL = ModuleRevisionId
-            .newInstance("", "org.apache.ivy.osgi.testbundle.importing.optional", "3.2.1",
-                BundleInfoAdapter.OSGI_BUNDLE);
+            .newInstance(BundleInfo.BUNDLE_TYPE,
+                "org.apache.ivy.osgi.testbundle.importing.optional", "3.2.1");
 
-    private static final ModuleRevisionId MRID_TEST_BUNDLE_USE = ModuleRevisionId.newInstance("",
-        "org.apache.ivy.osgi.testbundle.use", "2.2.2", BundleInfoAdapter.OSGI_BUNDLE);
+    private static final ModuleRevisionId MRID_TEST_BUNDLE_USE = ModuleRevisionId.newInstance(
+        BundleInfo.BUNDLE_TYPE, "org.apache.ivy.osgi.testbundle.use", "2.2.2");
 
     private static final ModuleRevisionId MRID_TEST_BUNDLE_EXPORTING_AMBIGUITY = ModuleRevisionId
-            .newInstance("", "org.apache.ivy.osgi.testbundle.exporting.ambiguity", "3.3.3",
-                BundleInfoAdapter.OSGI_BUNDLE);
+            .newInstance(BundleInfo.BUNDLE_TYPE,
+                "org.apache.ivy.osgi.testbundle.exporting.ambiguity", "3.3.3");
 
     private IvySettings settings;
 
@@ -146,20 +147,20 @@ public class OBRResolverTest extends Tes
     }
 
     public void testSimpleResolve() throws Exception {
-        ModuleRevisionId mrid = ModuleRevisionId.newInstance("", "org.apache.ivy.osgi.testbundle",
-            "1.2.3", BundleInfoAdapter.OSGI_BUNDLE);
+        ModuleRevisionId mrid = ModuleRevisionId.newInstance(BundleInfo.BUNDLE_TYPE, "org.apache.ivy.osgi.testbundle",
+            "1.2.3");
         genericTestResolveDownload(bundleResolver, mrid);
     }
 
     public void testSimpleUrlResolve() throws Exception {
-        ModuleRevisionId mrid = ModuleRevisionId.newInstance("", "org.apache.ivy.osgi.testbundle",
-            "1.2.3", BundleInfoAdapter.OSGI_BUNDLE);
+        ModuleRevisionId mrid = ModuleRevisionId.newInstance(BundleInfo.BUNDLE_TYPE, "org.apache.ivy.osgi.testbundle",
+            "1.2.3");
         genericTestResolveDownload(bundleUrlResolver, mrid);
     }
 
     public void testResolveDual() throws Exception {
-        ModuleRevisionId mrid = ModuleRevisionId.newInstance("", "org.apache.ivy.osgi.testbundle",
-            "1.2.3", BundleInfoAdapter.OSGI_BUNDLE);
+        ModuleRevisionId mrid = ModuleRevisionId.newInstance(BundleInfo.BUNDLE_TYPE, "org.apache.ivy.osgi.testbundle",
+            "1.2.3");
         genericTestResolveDownload(dualResolver, mrid);
     }
 
@@ -282,7 +283,8 @@ public class OBRResolverTest extends Tes
                 + jarName));
         BundleInfo bundleInfo = ManifestParser.parseManifest(in.getManifest());
         bundleInfo.setUri(new File("test/test-repo/bundlerepo/" + jarName).toURI());
-        DefaultModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(null, bundleInfo, null);
+        DefaultModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(
+            OSGiManifestParser.getInstance(), null, bundleInfo, null);
         ResolveReport resolveReport = ivy.resolve(md,
             new ResolveOptions().setConfs(new String[] {conf}).setOutputReport(false));
         assertFalse("resolve failed " + resolveReport.getAllProblemMessages(),
@@ -313,7 +315,8 @@ public class OBRResolverTest extends Tes
                 + jarName));
         BundleInfo bundleInfo = ManifestParser.parseManifest(in.getManifest());
         bundleInfo.setUri(new File("test/test-repo/bundlerepo/" + jarName).toURI());
-        DefaultModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(null, bundleInfo, null);
+        DefaultModuleDescriptor md = BundleInfoAdapter.toModuleDescriptor(
+            OSGiManifestParser.getInstance(), null, bundleInfo, null);
         ResolveReport resolveReport = ivy.resolve(md,
             new ResolveOptions().setConfs(new String[] {conf}).setOutputReport(false));
         assertTrue(resolveReport.hasError());

Modified: ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolverTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolverTest.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolverTest.java (original)
+++ ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteResolverTest.java Sun Apr 15 21:01:43 2012
@@ -37,7 +37,7 @@ import org.apache.ivy.core.resolve.Resol
 import org.apache.ivy.core.search.ModuleEntry;
 import org.apache.ivy.core.search.OrganisationEntry;
 import org.apache.ivy.core.settings.IvySettings;
-import org.apache.ivy.osgi.core.BundleInfoAdapter;
+import org.apache.ivy.osgi.core.BundleInfo;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 
 public class UpdateSiteResolverTest extends TestCase {
@@ -82,13 +82,18 @@ public class UpdateSiteResolverTest exte
 
     public void testListOrganization() throws Exception {
         OrganisationEntry[] orgs = resolver.listOrganisations();
-        assertEquals(1, orgs.length);
-        assertEquals("", orgs[0].getOrganisation());
+        assertEquals(2, orgs.length);
+        assertTrue((orgs[0].getOrganisation().equals(BundleInfo.BUNDLE_TYPE) && orgs[1]
+                .getOrganisation().equals(BundleInfo.PACKAGE_TYPE))
+                || (orgs[0].getOrganisation().equals(BundleInfo.PACKAGE_TYPE) && orgs[1]
+                        .getOrganisation().equals(BundleInfo.BUNDLE_TYPE)));
     }
 
     public void testListModules() throws Exception {
-        ModuleEntry[] modules = resolver.listModules(new OrganisationEntry(resolver, ""));
-        assertEquals(65, modules.length);
+        ModuleEntry[] modules = resolver.listModules(new OrganisationEntry(resolver, BundleInfo.BUNDLE_TYPE));
+        assertEquals(3, modules.length);
+        modules = resolver.listModules(new OrganisationEntry(resolver, BundleInfo.PACKAGE_TYPE));
+        assertEquals(64, modules.length);
     }
 
     private void genericTestResolveDownload(DependencyResolver resolver, ModuleRevisionId mrid)
@@ -124,8 +129,8 @@ public class UpdateSiteResolverTest exte
     }
 
     public void testResolve() throws Exception {
-        ModuleRevisionId mrid = ModuleRevisionId.newInstance("", "org.apache.ivy",
-            "2.0.0.final_20090108225011", BundleInfoAdapter.OSGI_BUNDLE);
+        ModuleRevisionId mrid = ModuleRevisionId.newInstance(BundleInfo.BUNDLE_TYPE,
+            "org.apache.ivy", "2.0.0.final_20090108225011");
         genericTestResolveDownload(resolver, mrid);
     }
 }

Modified: ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/util/VersionTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/util/VersionTest.java?rev=1326424&r1=1326423&r2=1326424&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/util/VersionTest.java (original)
+++ ant/ivy/core/branches/2.3.x/test/java/org/apache/ivy/osgi/util/VersionTest.java Sun Apr 15 21:01:43 2012
@@ -17,11 +17,13 @@
  */
 package org.apache.ivy.osgi.util;
 
+import java.text.ParseException;
+
 import junit.framework.TestCase;
 
 public class VersionTest extends TestCase {
 
-    public void testParsing() {
+    public void testParsing() throws Exception {
         Version v;
 
         v = new Version("1");
@@ -41,7 +43,7 @@ public class VersionTest extends TestCas
         assertEquals("abc", v.qualifier());
     }
 
-    public void testCompareTo() {
+    public void testCompareTo() throws Exception {
         assertTrue(new Version("1.2.3").compareTo(new Version("1.2.3")) == 0);
 
         assertTrue(new Version("1.2.3").compareTo(new Version("1.2.2")) > 0);



Mime
View raw message