Skip to content

Commit 2fc3187

Browse files
authored
Merge pull request #6363 from laeubi/process_with_conditional_package
Add testcase for conditional packages with bnd-process
2 parents cd347e1 + 3962626 commit 2fc3187

File tree

6 files changed

+69
-0
lines changed

6 files changed

+69
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This is an example bundle that used bnd-process together with conditional package.
2+
3+
Points of interest:
4+
5+
* the conditional packages apaer in the maven output folder
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
invoker.goals=--no-transfer-progress package
2+
3+
# Run mvn with --debug for debug logging
4+
#invoker.debug=true
5+
6+
# Run mvn in debugging mode and wait for a debugger to attach
7+
#invoker.environmentVariables.MAVEN_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-conditionalpackage: com.google.common.cache
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>biz.aQute.bnd-test</groupId>
7+
<artifactId>test</artifactId>
8+
<version>0.0.2</version>
9+
<relativePath>../process-parent</relativePath>
10+
</parent>
11+
<artifactId>test-bnd-process-conditional</artifactId>
12+
<version>0.0.1-SNAPSHOT</version>
13+
<licenses>
14+
<license>
15+
<name>Apache License, Version 2.0</name>
16+
<url>http://www.opensource.org/licenses/apache2.0.php</url>
17+
<distribution>repo</distribution>
18+
</license>
19+
</licenses>
20+
<dependencies>
21+
<dependency>
22+
<groupId>com.google.guava</groupId>
23+
<artifactId>guava</artifactId>
24+
<version>32.0.1-jre</version>
25+
</dependency>
26+
</dependencies>
27+
28+
<build>
29+
<plugins>
30+
<plugin>
31+
<groupId>biz.aQute.bnd</groupId>
32+
<artifactId>bnd-maven-plugin</artifactId>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
37+
</project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import java.util.jar.JarFile;
2+
import java.util.jar.JarEntry
3+
4+
JarFile jar = new JarFile( new File(basedir, 'target/test-bnd-process-conditional-0.0.1-SNAPSHOT.jar'))
5+
JarEntry entry = jar.getEntry('com/google/common/cache/Cache.class')
6+
assert entry != null
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.example.impl;
2+
3+
import java.util.concurrent.TimeUnit;
4+
5+
import com.google.common.cache.Cache;
6+
import com.google.common.cache.CacheBuilder;
7+
8+
public class Config {
9+
public static void main(String[] args) {
10+
Cache<String, String> myCache = CacheBuilder.newBuilder().maximumSize(100)
11+
.expireAfterWrite(30, TimeUnit.SECONDS).build();
12+
}
13+
}

0 commit comments

Comments
 (0)