You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Arkadi Shishlov (JIRA)" <ji...@apache.org> on 2011/03/09 21:19:59 UTC

[jira] Created: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Apache Camel version banner is wrong in uber-jar
------------------------------------------------

                 Key: CAMEL-3773
                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.6.0
            Reporter: Arkadi Shishlov
            Priority: Minor


At context start a version banner is printed to the log:
Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
The version string is calculated by ServiceSupport.getVersion():

Package aPackage = getClass().getPackage();
if (aPackage != null) {
    version = aPackage.getImplementationVersion();
    if (version == null) {
        version = aPackage.getSpecificationVersion();
    }
}

but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Reopened: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reopened CAMEL-3773:
--------------------------------


> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: uber-jar
>             Fix For: 2.8.0
>
>         Attachments: camel-getVersion-uber-jar.diff
>
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> {code}
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> {code}
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005036#comment-13005036 ] 

Claus Ibsen commented on CAMEL-3773:
------------------------------------

Thanks for the patch. 

However with loading resources using classloader can unfortunately be a bit tricky depending on the host platform.
For example OSGi, JBoss, J2EE app servers etc may not work as easily as you would have thought.

So we need to test your patch that it works seamless. Which it ought to do as you load a resource from within the same JAR that the given class is from. But we have seen issues in the past.


> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: uber-jar
>             Fix For: 2.8.0
>
>         Attachments: camel-getVersion-uber-jar.diff
>
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> {code}
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> {code}
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Issue Comment Edited: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004962#comment-13004962 ] 

Willem Jiang edited comment on CAMEL-3773 at 3/10/11 4:49 AM:
--------------------------------------------------------------

{code}
Apache Camel 2.6.0 (CamelContext: camel)
                                  ~~~~~~ This is the camel context name.
~~~~~~~~~~~~~~~~~~ This is camel version. 
{code}
             

      was (Author: njiang):
    Apache Camel 2.6.0 (CamelContext: camel)
                                  ~~~~~~ This is the camel context name.
~~~~~~~~~~~~~~~~~~ This is camel version. 

             
  
> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Priority: Minor
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Resolved: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3773.
--------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.8.0)
                   2.7.0

trunk: 1080929.

> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: uber-jar
>             Fix For: 2.7.0
>
>         Attachments: camel-getVersion-uber-jar.diff
>
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> {code}
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> {code}
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Resolved: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3773.
--------------------------------

       Resolution: Won't Fix
    Fix Version/s: 2.8.0
         Assignee: Claus Ibsen

> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004969#comment-13004969 ] 

Claus Ibsen commented on CAMEL-3773:
------------------------------------

Uber JARs is not supported. You should use the individual JARs we distribute.

> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Priority: Minor
>             Fix For: 2.8.0
>
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Arkadi Shishlov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arkadi Shishlov updated CAMEL-3773:
-----------------------------------

    Attachment: camel-getVersion-uber-jar.diff

> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: uber-jar
>             Fix For: 2.8.0
>
>         Attachments: camel-getVersion-uber-jar.diff
>
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> {code}
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> {code}
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Arkadi Shishlov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arkadi Shishlov updated CAMEL-3773:
-----------------------------------

         Labels: uber-jar  (was: )
    Description: 
At context start a version banner is printed to the log:
Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
The version string is calculated by ServiceSupport.getVersion():
{code}
Package aPackage = getClass().getPackage();
if (aPackage != null) {
    version = aPackage.getImplementationVersion();
    if (version == null) {
        version = aPackage.getSpecificationVersion();
    }
}
{code}
but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.


  was:
At context start a version banner is printed to the log:
Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
The version string is calculated by ServiceSupport.getVersion():

Package aPackage = getClass().getPackage();
if (aPackage != null) {
    version = aPackage.getImplementationVersion();
    if (version == null) {
        version = aPackage.getSpecificationVersion();
    }
}

but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.


     Patch Info: [Patch Available]

For the reference, here is my Maven shade plugin setup, which allows me to build fully working Camel uber-jar.
{noformat}
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>1.4</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <artifactSet>
                    <excludes>
                        <exclude>org.jboss.seam:jboss-seam</exclude>
                    </excludes>
                </artifactSet>
                <transformers>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                        <manifestEntries>
                            <Main-Class>com.tieto.cih.core.main.Main</Main-Class>
                            <Specification-Vendor>Tieto</Specification-Vendor>
                            <Implementation-Vendor>Tieto Latvia</Implementation-Vendor>
                        </manifestEntries>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                        <resource>META-INF/spring.handlers</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                        <resource>META-INF/spring.schemas</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                        <resource>META-INF/services/org/apache/camel/TypeConverter</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>

                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/maven/plugin.xml</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/spring.tooling</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/info.xml</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/DISCLAIMER</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/README.txt</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/DEPENDENCIES</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/LICENSE</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/LICENSE.txt</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/NOTICE</resource>
                    </transformer>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                        <resource>META-INF/NOTICE.txt</resource>
                    </transformer>
                </transformers>
            </configuration>
        </execution>
    </executions>
</plugin>
{noformat}
You might want to add this to FAQ to replace misleading answer.
Rejecting uber-jar distribution as a valid target is very inconvenient for SE deployment scenarios.

Attached patch is not exactly what the original getVersion() provided, but very close if we take in account current versioning scheme.


> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: uber-jar
>             Fix For: 2.8.0
>
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> {code}
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> {code}
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004975#comment-13004975 ] 

Claus Ibsen commented on CAMEL-3773:
------------------------------------

Btw there is a FAQ about the uber JAR issue
http://camel.apache.org/why-do-camel-throw-so-many-noclassdeffoundexception-on-startup.html

> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.0
>
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CAMEL-3773) Apache Camel version banner is wrong in uber-jar

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004962#comment-13004962 ] 

Willem Jiang commented on CAMEL-3773:
-------------------------------------

Apache Camel 2.6.0 (CamelContext: camel)
                                  ~~~~~~ This is the camel context name.
~~~~~~~~~~~~~~~~~~ This is camel version. 

             

> Apache Camel version banner is wrong in uber-jar
> ------------------------------------------------
>
>                 Key: CAMEL-3773
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3773
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Arkadi Shishlov
>            Priority: Minor
>
> At context start a version banner is printed to the log:
> Apache Camel 2.6.0 (CamelContext: camel) started in 2.436 seconds
> The version string is calculated by ServiceSupport.getVersion():
> Package aPackage = getClass().getPackage();
> if (aPackage != null) {
>     version = aPackage.getImplementationVersion();
>     if (version == null) {
>         version = aPackage.getSpecificationVersion();
>     }
> }
> but, in Maven shade-plugin packaged project (to create single uber-jar for distribution to SE environment), the Manifest versions are project version, not Camel. So the wrong version is printed. It would be nice to have this improved to print real Camel version.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira