karaf-maven-plugin generates feature descriptor with bad snaphot version

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

karaf-maven-plugin generates feature descriptor with bad snaphot version

Chris N.
Hello,

I'm using the karaf-maven-plugin to generate feature descriptors but I
discover that if the related bundle has a SNAPSHOT version, for example
"2.0.0-SNAPSHOT" then the feature generated has a version like
"2.0.0.SNAPSHOT" (take note of the dot instead of the dash). It seems that
the plugin worked well until the R4 (karaf-maven-plugin 3.0.9 generates the
version with the expected dash).
Did I miss anything?

Thanks
Christian



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: karaf-maven-plugin generates feature descriptor with bad snaphot version

Chris N.
This post was updated on .
Hello,

The  VersionCleaner
<https://github.com/apache/felix/blob/trunk/utils/src/main/java/org/apache/felix/utils/version/VersionCleaner.java
.clean() used in the  Feature
<https://github.com/apache/karaf/blob/master/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java
.setVersion() method is responsible of the problem, the following test:

    public static void main(String[] args) {
        String res = VersionCleaner.clean("2.0.0-SNAPSHOT");
        System.out.println(res);
    }

displays:
    2.0.0.SNAPSHOT

Did I miss something? :)

Christian



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: karaf-maven-plugin generates feature descriptor with bad snaphot version

jbonofre
Hi Chris,

it's normal IMHO: 2.0.0-SNAPSHOT is not a valid OSGi version.
2.0.0.SNAPSHOT is. As the feature resolver is an OSGi resolver, it deals
with OSGi version format.

So, if you want to use 2.0.0-SNAPSHOT, then, you have to write the
features XML by hand, else, the output looks good to me.

Regards
JB

On 14/06/2018 11:10, Chris N. wrote:

> Hello,
>
> The  VersionCleaner
> <https://github.com/apache/felix/blob/trunk/utils/src/main/java/org/apache/felix/utils/version/VersionCleaner.java>
> .clean() used in the  Feature
> <https://github.com/apache/karaf/blob/master/features/core/src/main/java/org/apache/karaf/features/internal/model/Feature.java>
> .setVersion() method is responsible of the problem, the following test:
>
>     public static void main(String[] args) {
>         String res = VersionCleaner.clean("2.0.0-SNAPSHOT");
>         System.out.println(res);
>     }
>
> displays:
>     2.0.0.SNAPSHOT
>
> Did I miss anything? :)
>
> Christian
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: karaf-maven-plugin generates feature descriptor with bad snaphot version

Chris N.
Thank Jean-Baptiste for your response!
Is it possible to add a plugin configuration property "useRawVersion"
(default to false) to bypass this behaviour?

            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <extensions>true</extensions>
                <goals>
                    <goal>features-generate-descriptor</goal>
                </goals>
                <configuration>
                    <enableGeneration>true</enableGeneration>
                    <aggregateFeatures>true</aggregateFeatures>
                    <useRawVersion>true</useRawVersion>
                </configuration>
            </plugin>

Thanks.
Chris



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: karaf-maven-plugin generates feature descriptor with bad snaphot version

jbonofre
Good idea.

Can you please create a Jira about that ?

Thanks !
Regards
JB

On 14/06/2018 12:03, Chris N. wrote:

> Thank Jean-Baptiste for your response!
> Is it possible to add a plugin configuration property "useRawVersion"
> (default to false) to bypass this behaviour?
>
>             <plugin>
>                 <groupId>org.apache.karaf.tooling</groupId>
>                 <artifactId>karaf-maven-plugin</artifactId>
>                 <extensions>true</extensions>
>                 <goals>
>                     <goal>features-generate-descriptor</goal>
>                 </goals>
>                 <configuration>
>                     <enableGeneration>true</enableGeneration>
>                     <aggregateFeatures>true</aggregateFeatures>
>                     <useRawVersion>true</useRawVersion>
>                 </configuration>
>             </plugin>
>
> Thanks.
> Chris
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: karaf-maven-plugin generates feature descriptor with bad snaphot version

Chris N.
Reply | Threaded
Open this post in threaded view
|

Re: karaf-maven-plugin generates feature descriptor with bad snaphot version

jbonofre
Hi,

thanks !

You can create a PR on github.

Regards
JB

On 18/06/2018 18:01, Chris N. wrote:

> Done!
> https://issues.apache.org/jira/browse/KARAF-5788
> <https://issues.apache.org/jira/browse/KARAF-5788>  
>
> I have already an implementation, how can I participate?
>
> Christian
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: karaf-maven-plugin generates feature descriptor with bad snaphot version

jbonofre
In reply to this post by Chris N.
By the way, you can take a look on the contribution guide:

http://karaf.apache.org/community.html

Regards
JB

On 18/06/2018 18:01, Chris N. wrote:

> Done!
> https://issues.apache.org/jira/browse/KARAF-5788
> <https://issues.apache.org/jira/browse/KARAF-5788>  
>
> I have already an implementation, how can I participate?
>
> Christian
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com