Re: svn commit: r991463 - in /karaf/trunk/tooling/features-maven-plugin/src: main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r991463 - in /karaf/trunk/tooling/features-maven-plugin/src: main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java

Guillaume Nodet
Shoudn't we not include "jar" as it's the default value ?

On Wed, Sep 1, 2010 at 10:23,  <[hidden email]> wrote:

> Author: jbonofre
> Date: Wed Sep  1 08:23:10 2010
> New Revision: 991463
>
> URL: http://svn.apache.org/viewvc?rev=991463&view=rev
> Log:
> [KARAF-163] Generate Features XML should handle artifact types.
>
> Modified:
>    karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java
>    karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java
>
> Modified: karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java
> URL: http://svn.apache.org/viewvc/karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java?rev=991463&r1=991462&r2=991463&view=diff
> ==============================================================================
> --- karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java (original)
> +++ karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java Wed Sep  1 08:23:10 2010
> @@ -507,7 +507,7 @@ public class GenerateFeaturesXmlMojo ext
>     }
>
>     public static String toString(Artifact artifact) {
> -        return String.format("%s/%s/%s", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion());
> +        return String.format("%s/%s/%s/%s", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
>     }
>
>     private class Feature {
> @@ -554,8 +554,8 @@ public class GenerateFeaturesXmlMojo ext
>                     out.println("    <feature version='"
>                        + next.getBaseVersion() + "'>" + String.format("%s</feature>", next.getArtifactId()));
>                 } else {
> -                       out.println(String.format("    <bundle>mvn:%s/%s/%s</bundle>",
> -                            next.getGroupId(), next.getArtifactId(), next.getBaseVersion()));
> +                       out.println(String.format("    <bundle>mvn:%s/%s/%s/%s</bundle>",
> +                            next.getGroupId(), next.getArtifactId(), next.getBaseVersion(), next.getType()));
>                 }
>             }
>             out.println("  </feature>");
>
> Modified: karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java
> URL: http://svn.apache.org/viewvc/karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java?rev=991463&r1=991462&r2=991463&view=diff
> ==============================================================================
> --- karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java (original)
> +++ karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java Wed Sep  1 08:23:10 2010
> @@ -34,10 +34,11 @@ public class GenerateFeaturesXmlMojoTest
>         expect(artifact.getGroupId()).andReturn("org.apache.karaf.test");
>         expect(artifact.getArtifactId()).andReturn("test-artifact");
>         expect(artifact.getVersion()).andReturn("1.2.3");
> +        expect(artifact.getType()).andReturn("jar");
>
>         replay(artifact);
>
> -        assertEquals("org.apache.karaf.test/test-artifact/1.2.3", GenerateFeaturesXmlMojo.toString(artifact));
> +        assertEquals("org.apache.karaf.test/test-artifact/1.2.3/jar", GenerateFeaturesXmlMojo.toString(artifact));
>     }
>
>  }
>
>
>



--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r991463 - in /karaf/trunk/tooling/features-maven-plugin/src: main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java

jbonofre
Agree, to have the same default behavior.

I update the patch.

Regards
JB

On 09/01/2010 10:42 AM, Guillaume Nodet wrote:

> Shoudn't we not include "jar" as it's the default value ?
>
> On Wed, Sep 1, 2010 at 10:23,<[hidden email]>  wrote:
>> Author: jbonofre
>> Date: Wed Sep  1 08:23:10 2010
>> New Revision: 991463
>>
>> URL: http://svn.apache.org/viewvc?rev=991463&view=rev
>> Log:
>> [KARAF-163] Generate Features XML should handle artifact types.
>>
>> Modified:
>>     karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java
>>     karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java
>>
>> Modified: karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java
>> URL: http://svn.apache.org/viewvc/karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java?rev=991463&r1=991462&r2=991463&view=diff
>> ==============================================================================
>> --- karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java (original)
>> +++ karaf/trunk/tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojo.java Wed Sep  1 08:23:10 2010
>> @@ -507,7 +507,7 @@ public class GenerateFeaturesXmlMojo ext
>>      }
>>
>>      public static String toString(Artifact artifact) {
>> -        return String.format("%s/%s/%s", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion());
>> +        return String.format("%s/%s/%s/%s", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
>>      }
>>
>>      private class Feature {
>> @@ -554,8 +554,8 @@ public class GenerateFeaturesXmlMojo ext
>>                      out.println("<feature version='"
>>                         + next.getBaseVersion() + "'>" + String.format("%s</feature>", next.getArtifactId()));
>>                  } else {
>> -                       out.println(String.format("<bundle>mvn:%s/%s/%s</bundle>",
>> -                            next.getGroupId(), next.getArtifactId(), next.getBaseVersion()));
>> +                       out.println(String.format("<bundle>mvn:%s/%s/%s/%s</bundle>",
>> +                            next.getGroupId(), next.getArtifactId(), next.getBaseVersion(), next.getType()));
>>                  }
>>              }
>>              out.println("</feature>");
>>
>> Modified: karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java
>> URL: http://svn.apache.org/viewvc/karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java?rev=991463&r1=991462&r2=991463&view=diff
>> ==============================================================================
>> --- karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java (original)
>> +++ karaf/trunk/tooling/features-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateFeaturesXmlMojoTest.java Wed Sep  1 08:23:10 2010
>> @@ -34,10 +34,11 @@ public class GenerateFeaturesXmlMojoTest
>>          expect(artifact.getGroupId()).andReturn("org.apache.karaf.test");
>>          expect(artifact.getArtifactId()).andReturn("test-artifact");
>>          expect(artifact.getVersion()).andReturn("1.2.3");
>> +        expect(artifact.getType()).andReturn("jar");
>>
>>          replay(artifact);
>>
>> -        assertEquals("org.apache.karaf.test/test-artifact/1.2.3", GenerateFeaturesXmlMojo.toString(artifact));
>> +        assertEquals("org.apache.karaf.test/test-artifact/1.2.3/jar", GenerateFeaturesXmlMojo.toString(artifact));
>>      }
>>
>>   }
>>
>>
>>
>
>
>