Petals CDK

The version of the component should be logged on installation

Details

  • Type: Improvement Request Improvement Request
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 5.0.3
  • Fix Version/s: 5.1.1
  • Component/s: runtime
  • Security Level: Public
  • Description:
    Hide

    An information message about the component version should be added during the installation phase.

    The version should be read from Maven metadata (META-INF/maven/${groupId}/${artifactId}/pom.properties) embedded into the JAR of the component embedded into the component JBI archive

    Show
    An information message about the component version should be added during the installation phase. The version should be read from Maven metadata (META-INF/maven/${groupId}/${artifactId}/pom.properties) embedded into the JAR of the component embedded into the component JBI archive
  • Environment:
    -

Issue Links

Activity

Christophe DENEUX made changes - Fri, 27 Aug 2010 - 19:58:55 +0200
Field Original Value New Value
Link This issue depends on PETALSSETAL-3 [ PETALSSETAL-3 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:00:05 +0200
Link This issue blocks PETALSSEQUARTZ-2 [ PETALSSEQUARTZ-2 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:00:33 +0200
Link This issue depends on PETALSSETAL-3 [ PETALSSETAL-3 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:01:38 +0200
Link This issue blocks PETALSSETAL-2 [ PETALSSETAL-2 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:02:49 +0200
Link This issue blocks PETALSBCSQL-1 [ PETALSBCSQL-1 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:02:49 +0200
Link This issue blocks PETALSSEBPEL-9 [ PETALSSEBPEL-9 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:02:49 +0200
Link This issue blocks PETALSSEJSR-5 [ PETALSSEJSR-5 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:11:16 +0200
Link This issue blocks PETALSSEXSLT-10 [ PETALSSEXSLT-10 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:14:04 +0200
Link This issue blocks PETALSBCMAIL-8 [ PETALSBCMAIL-8 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:14:04 +0200
Link This issue blocks PETALSBCFTRANS-9 [ PETALSBCFTRANS-9 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:14:04 +0200
Link This issue blocks PETALSBCFTP-13 [ PETALSBCFTP-13 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:14:04 +0200
Link This issue blocks PETALSBCSFTP-25 [ PETALSBCSFTP-25 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:14:04 +0200
Link This issue blocks PETALSSEEIP-3 [ PETALSSEEIP-3 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:14:04 +0200
Link This issue blocks PETALSSENOTIF-5 [ PETALSSENOTIF-5 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:14:04 +0200
Link This issue blocks PETALSSEKPI-7 [ PETALSSEKPI-7 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:14:04 +0200
Link This issue blocks PETALSSEPOJO-5 [ PETALSSEPOJO-5 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:14:04 +0200
Link This issue blocks PETALSSEVALID-3 [ PETALSSEVALID-3 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:22:34 +0200
Link This issue blocks PETALSBCJMS-3 [ PETALSBCJMS-3 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:22:34 +0200
Link This issue blocks PETALSSERMI-1 [ PETALSSERMI-1 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:22:34 +0200
Link This issue blocks PETALSSESCA-7 [ PETALSSESCA-7 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:22:34 +0200
Link This issue blocks PETALSBCEJB-2 [ PETALSBCEJB-2 ]
Christophe DENEUX made changes - Fri, 27 Aug 2010 - 20:22:34 +0200
Link This issue blocks PETALSBCSOAP-36 [ PETALSBCSOAP-36 ]
Hide
Christophe Hamerling added a comment - Mon, 30 Aug 2010 - 10:11:02 +0200

Some will say that we can not rely on maven for such thing...

Show
Christophe Hamerling added a comment - Mon, 30 Aug 2010 - 10:11:02 +0200 Some will say that we can not rely on maven for such thing...
Hide
Christophe DENEUX added a comment - Mon, 30 Aug 2010 - 11:02:32 +0200

And why ?

Show
Christophe DENEUX added a comment - Mon, 30 Aug 2010 - 11:02:32 +0200 And why ?
Hide
Christophe Hamerling added a comment - Mon, 30 Aug 2010 - 11:07:49 +0200

Why not? Why not using standard thing such as a Version class? This is generally the standard way to provide a version (or the most used in the java world)

Show
Christophe Hamerling added a comment - Mon, 30 Aug 2010 - 11:07:49 +0200 Why not? Why not using standard thing such as a Version class? This is generally the standard way to provide a version (or the most used in the java world)
Hide
Mathieu Carrolle added a comment - Mon, 30 Aug 2010 - 11:20:28 +0200

We can use the node identification in the jbi descriptor. This node could be extended.
The result could be :

<component type="binding-component">
<identification>
<name>petals-bc-ftp</name>
<description>fhdhdfh</description>
<cdk:VersionInfo component-version="1.0"/>
</identification>

Show
Mathieu Carrolle added a comment - Mon, 30 Aug 2010 - 11:20:28 +0200 We can use the node identification in the jbi descriptor. This node could be extended. The result could be : <component type="binding-component"> <identification> <name>petals-bc-ftp</name> <description>fhdhdfh</description> <cdk:VersionInfo component-version="1.0"/> </identification>
Hide
Vincent Zurczak added a comment - Mon, 30 Aug 2010 - 11:45:24 +0200

Or we could just add an abstract method in the AbstractComponent class:

String getComponentVersion();

The CDK would use it to get the component version and display this information.

Show
Vincent Zurczak added a comment - Mon, 30 Aug 2010 - 11:45:24 +0200 Or we could just add an abstract method in the AbstractComponent class: String getComponentVersion(); The CDK would use it to get the component version and display this information.
Hide
Christophe Hamerling added a comment - Mon, 30 Aug 2010 - 11:53:49 +0200

Of course, we need to ass a method in the API, for now we try to select the best solution to retrieve the information.

Show
Christophe Hamerling added a comment - Mon, 30 Aug 2010 - 11:53:49 +0200 Of course, we need to ass a method in the API, for now we try to select the best solution to retrieve the information.
Hide
Roland Naudin added a comment - Mon, 30 Aug 2010 - 11:58:05 +0200 - edited

I was speaking about that with mathieu.
And we come to that:
-For the current version of the CDK 5.x, we think that using the version in the manifest of the jar built by the JAR maven plugin is the easiest way at runtime to get the version.
-For a futur CDK (6), maybe using the extension of the identification, depends on how we will decide that we handle the conf on that version.

-> The Version will be handled (print, expose to the admin channel) only by the CDK.
is it interesting to get the version at the component specific level? i'm not sure.

Show
Roland Naudin added a comment - Mon, 30 Aug 2010 - 11:58:05 +0200 - edited I was speaking about that with mathieu. And we come to that: -For the current version of the CDK 5.x, we think that using the version in the manifest of the jar built by the JAR maven plugin is the easiest way at runtime to get the version. -For a futur CDK (6), maybe using the extension of the identification, depends on how we will decide that we handle the conf on that version. -> The Version will be handled (print, expose to the admin channel) only by the CDK. is it interesting to get the version at the component specific level? i'm not sure.
Hide
Christophe DENEUX added a comment - Mon, 30 Aug 2010 - 12:20:48 +0200

I prefer:

  • First, use the version in the manifest of the jar built by Maven
  • If no version available, use the identification extension that is not mandatory.
  • If no version available, use a defautlt value 'No version set'

So, only an upgrade version of the CDK is needed to integrate this improvment in our components.
The version can be changed by users using the identification extension. To add it just use the goal 'jbi:configure' of the maven-petals-plugin (an issue should be created for this evolution of the maven-petals-plugin)

Show
Christophe DENEUX added a comment - Mon, 30 Aug 2010 - 12:20:48 +0200 I prefer:
  • First, use the version in the manifest of the jar built by Maven
  • If no version available, use the identification extension that is not mandatory.
  • If no version available, use a defautlt value 'No version set'
So, only an upgrade version of the CDK is needed to integrate this improvment in our components. The version can be changed by users using the identification extension. To add it just use the goal 'jbi:configure' of the maven-petals-plugin (an issue should be created for this evolution of the maven-petals-plugin)
Hide
Christophe Hamerling added a comment - Mon, 30 Aug 2010 - 12:28:44 +0200

Agree with that. With this solution we will be able to differentiate specific customer versions for example.

Show
Christophe Hamerling added a comment - Mon, 30 Aug 2010 - 12:28:44 +0200 Agree with that. With this solution we will be able to differentiate specific customer versions for example.
Hide
Christophe DENEUX added a comment - Thu, 7 Oct 2010 - 19:08:27 +0200

To read the version from the manifest, you can use the following source code with a class name defined in the JBI descriptor of the component

String pathToThisClass = Main.class.getResource("/foo/bar/MyClass.class").toString();
String manifestPath = pathToGlazedLists.substring(0, pathToGlazedLists.lastIndexOf("!") + 1) + "/META-INF/MANIFEST.MF";
Manifest manifest = new Manifest(new URL(manifestPath).openStream());

Attributes attr = manifest.getMainAttributes();

String CREATED_BY = attr.getValue("Created-by");
String SOFTWARE_VERSION = attr.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
String SOFTWARE_VENDOR = attr.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
String SOFTWARE_VENDOR_TITLE = attr.getValue(Attributes.Name.IMPLEMENTATION_TITLE);

Note: don't forget to close stream.

On the component side, just add the maven-jar-plugin to customize the Manifest

Show
Christophe DENEUX added a comment - Thu, 7 Oct 2010 - 19:08:27 +0200 To read the version from the manifest, you can use the following source code with a class name defined in the JBI descriptor of the component
String pathToThisClass = Main.class.getResource("/foo/bar/MyClass.class").toString();
String manifestPath = pathToGlazedLists.substring(0, pathToGlazedLists.lastIndexOf("!") + 1) + "/META-INF/MANIFEST.MF";
Manifest manifest = new Manifest(new URL(manifestPath).openStream());

Attributes attr = manifest.getMainAttributes();

String CREATED_BY = attr.getValue("Created-by");
String SOFTWARE_VERSION = attr.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
String SOFTWARE_VENDOR = attr.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
String SOFTWARE_VENDOR_TITLE = attr.getValue(Attributes.Name.IMPLEMENTATION_TITLE);
Note: don't forget to close stream. On the component side, just add the maven-jar-plugin to customize the Manifest
Mathieu Carrolle made changes - Fri, 8 Oct 2010 - 09:42:54 +0200
Status New [ 10000 ] Open [ 10002 ]
Priority Blocker [ 1 ]
Mathieu Carrolle made changes - Fri, 8 Oct 2010 - 09:43:03 +0200
Priority Blocker [ 1 ] Minor [ 4 ]
Mathieu Carrolle made changes - Fri, 8 Oct 2010 - 17:21:16 +0200
Status Open [ 10002 ] In Progress [ 10003 ]
Mathieu Carrolle made changes - Fri, 8 Oct 2010 - 17:26:23 +0200
Original Estimate 0 minutes [ 0 ]
Remaining Estimate 0 minutes [ 0 ]
Mathieu Carrolle made changes - Fri, 8 Oct 2010 - 17:26:24 +0200
Status In Progress [ 10003 ] Resolved [ 10004 ]
Resolution Fixed [ 1 ]
Hide
Mathieu Carrolle added a comment - Fri, 8 Oct 2010 - 17:32:20 +0200

The pom parent of the component need to be petals-components-sls-parent (version > 3)

Show
Mathieu Carrolle added a comment - Fri, 8 Oct 2010 - 17:32:20 +0200 The pom parent of the component need to be petals-components-sls-parent (version > 3)
Mathieu Carrolle made changes - Tue, 2 Nov 2010 - 17:02:33 +0100
Fix Version/s 5.1.1 [ 10152 ]
Transition Status Change Time Execution Times Last Executer Last Execution Date
New New Open Open
41d 13h 44m
1
Mathieu Carrolle
Fri, 8 Oct 2010 - 09:42:54 +0200
Open Open In Progress In Progress
7h 38m
1
Mathieu Carrolle
Fri, 8 Oct 2010 - 17:21:16 +0200
In Progress In Progress Resolved Resolved
5m 8s
1
Mathieu Carrolle
Fri, 8 Oct 2010 - 17:26:24 +0200



People

Dates

  • Created:
    Fri, 27 Aug 2010 - 19:58:31 +0200
    Updated:
    Tue, 2 Nov 2010 - 17:03:12 +0100
    Resolved:
    Fri, 8 Oct 2010 - 17:26:24 +0200