-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for #6364 to ensure that runbundles decorator is applied to the r…
…unbundles resolver output as well. Signed-off-by: Arnoud Glimmerveen <[email protected]>
- Loading branch information
1 parent
8e5cfa7
commit 509d0e2
Showing
9 changed files
with
224 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...aven-plugin/src/it/resolve-with-runstartlevel-and-runbundles-decorator/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
invoker.goals=--no-transfer-progress package | ||
|
||
# Run mvn with --debug for debug logging | ||
#invoker.debug=true | ||
|
||
# Run mvn in debugging mode and wait for a debugger to attach | ||
#invoker.environmentVariables.MAVEN_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 |
50 changes: 50 additions & 0 deletions
50
...-resolver-maven-plugin/src/it/resolve-with-runstartlevel-and-runbundles-decorator/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>biz.aQute.bnd-test</groupId> | ||
<artifactId>resolver-test</artifactId> | ||
<version>0.0.1</version> | ||
<relativePath>../parent</relativePath> | ||
</parent> | ||
|
||
<artifactId>resolve-with-starlevel-and-runbundles-decorator</artifactId> | ||
<version>0.0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>1.7.36</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<version>1.2.13</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.apache.felix.eventadmin</artifactId> | ||
<version>1.4.8</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.apache.felix.framework</artifactId> | ||
<version>5.4.0</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-resolver-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
39 changes: 39 additions & 0 deletions
39
...-maven-plugin/src/it/resolve-with-runstartlevel-and-runbundles-decorator/postbuild.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import aQute.bnd.build.Workspace | ||
import aQute.bnd.build.model.BndEditModel | ||
import aQute.bnd.osgi.Processor | ||
import aQute.bnd.properties.Document | ||
import aQute.lib.io.IO; | ||
|
||
// The resolve-with-starlevel-and-runbundles-decorator case | ||
|
||
// Check the bndrun file exist! | ||
File bndrunFile = new File(basedir, 'test.bndrun') | ||
assert bndrunFile.isFile() | ||
|
||
// Load the BndEditModel of the bndrun file so we can inspect the result | ||
Processor processor = new Processor() | ||
processor.setProperties(bndrunFile) | ||
BndEditModel bem = new BndEditModel(Workspace.createStandaloneWorkspace(processor, bndrunFile.toURI())) | ||
Document doc = new Document(IO.collect(bndrunFile)) | ||
bem.loadFrom(doc) | ||
|
||
// Get the -runbundles. | ||
def bemRunBundles = bem.getRunBundles() | ||
assert bemRunBundles | ||
assert bemRunBundles.size() == 4 | ||
|
||
StringBuilder sb = new StringBuilder() | ||
bemRunBundles.get(0).formatTo(sb) | ||
assert sb.toString() == "org.apache.felix.eventadmin;version='[1.4.8,1.4.9)';startlevel=1000" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(1).formatTo(sb) | ||
assert sb.toString() == "ch.qos.logback.core;version='[1.2.13,1.2.14)';startlevel=1001" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(2).formatTo(sb) | ||
assert sb.toString() == "ch.qos.logback.classic;version='[1.2.13,1.2.14)';startlevel=1002" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(3).formatTo(sb) | ||
assert sb.toString() == "slf4j.api;version='[1.7.36,1.7.37)';startlevel=999" |
11 changes: 11 additions & 0 deletions
11
...olver-maven-plugin/src/it/resolve-with-runstartlevel-and-runbundles-decorator/test.bndrun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-runfw: org.apache.felix.framework | ||
-runrequires: \ | ||
osgi.identity;filter:='(osgi.identity=org.apache.felix.eventadmin)',\ | ||
osgi.identity;filter:='(osgi.identity=slf4j.api)' | ||
|
||
-runbundles+: slf4j.api; startlevel=999 | ||
|
||
-runstartlevel: \ | ||
order = leastdependenciesfirst, \ | ||
begin = 1000, \ | ||
step = 1 |
7 changes: 7 additions & 0 deletions
7
maven-plugins/bnd-resolver-maven-plugin/src/it/resolve-with-runstartlevel/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
invoker.goals=--no-transfer-progress package | ||
|
||
# Run mvn with --debug for debug logging | ||
#invoker.debug=true | ||
|
||
# Run mvn in debugging mode and wait for a debugger to attach | ||
#invoker.environmentVariables.MAVEN_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 |
50 changes: 50 additions & 0 deletions
50
maven-plugins/bnd-resolver-maven-plugin/src/it/resolve-with-runstartlevel/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>biz.aQute.bnd-test</groupId> | ||
<artifactId>resolver-test</artifactId> | ||
<version>0.0.1</version> | ||
<relativePath>../parent</relativePath> | ||
</parent> | ||
|
||
<artifactId>resolve-with-starlevel</artifactId> | ||
<version>0.0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>1.7.36</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<version>1.2.13</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.apache.felix.eventadmin</artifactId> | ||
<version>1.4.8</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.apache.felix.framework</artifactId> | ||
<version>5.4.0</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-resolver-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
39 changes: 39 additions & 0 deletions
39
maven-plugins/bnd-resolver-maven-plugin/src/it/resolve-with-runstartlevel/postbuild.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import aQute.bnd.build.Workspace | ||
import aQute.bnd.build.model.BndEditModel | ||
import aQute.bnd.osgi.Processor | ||
import aQute.bnd.properties.Document | ||
import aQute.lib.io.IO; | ||
|
||
// The resolve-with-starlevel case | ||
|
||
// Check the bndrun file exist! | ||
File bndrunFile = new File(basedir, 'test.bndrun') | ||
assert bndrunFile.isFile() | ||
|
||
// Load the BndEditModel of the bndrun file so we can inspect the result | ||
Processor processor = new Processor() | ||
processor.setProperties(bndrunFile) | ||
BndEditModel bem = new BndEditModel(Workspace.createStandaloneWorkspace(processor, bndrunFile.toURI())) | ||
Document doc = new Document(IO.collect(bndrunFile)) | ||
bem.loadFrom(doc) | ||
|
||
// Get the -runbundles. | ||
def bemRunBundles = bem.getRunBundles() | ||
assert bemRunBundles | ||
assert bemRunBundles.size() == 4 | ||
|
||
StringBuilder sb = new StringBuilder() | ||
bemRunBundles.get(0).formatTo(sb) | ||
assert sb.toString() == "org.apache.felix.eventadmin;version='[1.4.8,1.4.9)';startlevel=1000" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(1).formatTo(sb) | ||
assert sb.toString() == "ch.qos.logback.core;version='[1.2.13,1.2.14)';startlevel=1001" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(2).formatTo(sb) | ||
assert sb.toString() == "ch.qos.logback.classic;version='[1.2.13,1.2.14)';startlevel=1002" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(3).formatTo(sb) | ||
assert sb.toString() == "slf4j.api;version='[1.7.36,1.7.37)';startlevel=1003" |
9 changes: 9 additions & 0 deletions
9
maven-plugins/bnd-resolver-maven-plugin/src/it/resolve-with-runstartlevel/test.bndrun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-runfw: org.apache.felix.framework | ||
-runrequires: \ | ||
osgi.identity;filter:='(osgi.identity=org.apache.felix.eventadmin)',\ | ||
osgi.identity;filter:='(osgi.identity=slf4j.api)' | ||
|
||
-runstartlevel: \ | ||
order = leastdependenciesfirst, \ | ||
begin = 1000, \ | ||
step = 1 |