CDV ❯ maven plugin: bootjar creation failed
-
Bug
-
Status: Closed
-
0 Showstopper
-
Resolution: Fixed
-
-
-
hhuynh
-
Reporter: tgautier
-
October 13, 2007
-
0
-
Watchers: 1
-
January 23, 2008
-
October 30, 2007
Attachments
Description
[INFO] [tc:run]
2007-10-12 22:15:55,674 INFO - Terracotta trunk-nightly-rev5925, as of 20071011-181024 (Revision 5925 by cruise@rh4mo0 from trunk)
2007-10-12 22:15:56,094 INFO - Configuration loaded from the file at ‘/Users/tgautier/src/forge/projects/labs/webcasts/dist-cache/target/classes/tc-config.xml’.
[INFO] Resolving modules: [
Comments
Taylor Gautier 2007-10-13
Taylor Gautier 2007-10-13
Note further that upon hitting this exception, it would be nice to print out the offending module - or rather in case of any failure to load a module, to print out the offending module.
Eugene Kuleshov 2007-10-13
Taylor, please attach pom.xml and tc-config.xml from your project. BTW, does the same config work from the kit?
Taylor Gautier 2007-10-15
offending pom.xml
Taylor Gautier 2007-10-15
https://svn.terracotta.org/repo/forge/projects/labs/webcasts/dist-cache
Eugene Kuleshov 2007-10-16
Taylor, version of your module in [1] isn’t compatible with osgi versions. We discussed at the meeting that we could actually recognize “-SNAPSHOT” suffix and replace it with “.SNAPSHOT” but it still won’t work for 2 number versions. So, you should use 1.0.0.SNAPSHOT :
[1] https://svn.terracotta.org/repo/forge/projects/labs/webcasts/dist-cache/src/main/resources/tc-config.xml
Taylor Gautier 2007-10-18
We agreed on Tuesday that we would enable versions to be 1.0.0-SNAPSHOT.
Eugene Kuleshov 2007-10-18
I’ll look at that on Monday. However please note that it won’t resolve issue for you as I already explained in my previous comment. You have the following entry in your tc-config.xml
converted OSGi version 1.0.SNAPSHOT still going to be invalid. So, you’ll have to fix your projects anyways.
Anyways, current workaround is to use version “1.0.0.SNAPSHOT” in tc-config.xml
Alex Miller 2007-10-19
Egads, this is what I’ve been hitting for the last day. I’ve been talking at length to Juris this morning to understand fully what’s happening. Let me see if I can restate in a way that helps. I think Eugene is saying it above but not in enough detail.
Currently, config modules extend the config-module-parent pom.xml which uses the maven jar plugin to create a jar with a bundle manifest where the bundle version is set to ${project.version}. So, the result of building any config module that extends from this is a jar which has an OSGi manifest with a version bound to the module’s Maven project version.
The ${project.version} is typically set to something like 1.0-SNAPSHOT. This affects the name of the jar and the location in the Maven repository and how you reference it as a tc-config module. To date, there have been a bunch of changes to allow us to resolve in a repository the location of a jar using either .SNAPSHOT or -SNAPSHOT and that’s all well and good.
The problem above occurs when you start trying to use the jar you found in an OSGi context. And the problem is that the jar is broken. The bundle version in the manifest is bound to the project version which had -SNAPSHOT on the end and that is simply not valid in OSGi. So, regardless of any manipulations we do to resolve this jar in the repository, it’s not going to work when we give it to Knoplerfish.
Apparently Juris and Gary have some changes designed to address the exception seen above but I suspect that only moves the problem one step further downstream as the bundle is still irretrievably broken. I can’t imagine any way to fix this problem other than to break the hard tie between the bundle version and the Maven project version. Maybe we could extend the Maven jar plugin to “fix” the version number before it goes into the bundle version property.
BTW, I ran into a similar problem in tying the bundle symbolic name to the Maven artifact ID. For example, the terracotta-cache module has an artifact ID of “terracotta-cache” but the “-“ is invalid in an OSGi symbolic name, so I’m manually changing to _. I can only do that by NOT extending from the config-module-parent which hard-codes this linkage.
Fiona OShea 2007-10-23
This is a very high priority to resolve.
Juris Galang 2007-10-30
We now allow users to specify -SNAPSHOT from tc-config; However the MANIFEST file for the TIM must still use .SNAPSHOT for the Bundle-Version entry.
The characters dash, underscore, and dot are allowed for Bundle-Name, and Bundle-SymbolicName entries.
This is resolved.
Juris Galang 2007-10-30
See comment above.
NOTE: The bundle that was failing here (annotations) happens to be a badly constructed TIM — so there’s actually two issues here:
- We didn’t use to allow -SNAPSHOT in tc-config (now we do)
- The annotations TIM is broken - the manifest file is not configured correctly. I’ve created a new JIRA issue for this.
Note that I did not specify any modules in my config file with a version of 1-SNAPSHOT