Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357695

Summary: Support default beginning version ranges in Maven Virgo Bundlor Import-Template header
Product: [RT] Virgo Reporter: Matthew Adams <matthew>
Component: toolingAssignee: Project Inbox <virgo-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse, mlippert
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 368782    

Description Matthew Adams CLA 2011-09-14 17:30:18 EDT
Build Identifier: 1.1.0.M01

Currently, the Bundlor requires that a property be manually set to specify a version range or version pattern if Bundlor is to do version calculation.  It would be nice in the Maven plugin if the plugin itself used the version information of the bundle's dependencies in the absence of a developer-supplied property in the Import-Templates header.  For example:

Version-Patterns:
 next-major;pattern="[=.=.=.=, +1.0.0)",
 next-minor;pattern="[=.=.=.=, =.+1.0)",
 next-micro;pattern="[=.=.=.=, =.=.+1)"
Import-Templates:
 javax.persistence*;version="${:next-micro}",
 *;version="${:next-major}"

Since there's no property name to the left of the colon in each Import-Templates line, the Maven plugin would provide reasonable values.  For example, if the maven dependencies were

<dependency>
	<groupId>org.eclipse.persistence</groupId>
	<artifactId>javax.persistence</artifactId>
	<version>2.0.0</version>
</dependency>
<dependency>
	<groupId>javax.transaction</groupId>
	<artifactId>com.springsource.javax.transaction</artifactId>
	<version>1.1.0</version>
</dependency>
<dependency>
	<groupId>org.foobar</groupId>
	<artifactId>blargy</artifactId>
	<version>4.5.6</version>
</dependency>

then the resultant manifest entry would be

Import-Package:
 javax.persistence;version="[2.0.0,2.0.1)",
 javax.persistence.spi;version="[2.0.0,2.0.1)",
 javax.persistence.metamodel;version="[2.0.0,2.0.1)",
 javax.persistence.criteria;version="[2.0.0,2.0.1)",
 javax.transaction;version="[1.1.0,2.0.0)",
 javax.transaction.xa;version="[1.1.0,2.0.0)"
 org.foobar.blargy;version="[4.5.6,5.0.0)"
 org.foobar.blargy.blarg;version="[4.5.6,5.0.0)"
 org.foobar.blargy.florch;version="[4.5.6,5.0.0)"

That way the developer doesn't have to manually update package-x=version-y properties in a separate file.

Reproducible: Always

Steps to Reproduce:
(new feature)
Comment 1 Miles Parker CLA 2012-01-16 19:27:39 EST
*** Bug 357684 has been marked as a duplicate of this bug. ***