Pax Exam 在 karaf lib/ext 文件夹中复制一个 jar

Pax Exam Copy a jar in karaf lib/ext folder

有没有办法在开始 pax-exam 时复制 karaf lib/ext 文件夹中的 jar

@Configuration
    public static Option[] configuration() throws Exception {
        return new Option[] {
                karafDistributionConfiguration().frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf")
                        .type("zip").version("4.0.1"))
                .unpackDirectory(new File("target/paxexam/unpack/"))
                .useDeployFolder(false),
                KarafDistributionOption.debugConfiguration("8898", true),
                configureConsole().ignoreLocalConsole(),
                logLevel(LogLevel.INFO),
                keepRuntimeFolder(),

        };
    }

我找到了解决办法。下面的代码将解决这个问题

@Configuration
    public static Option[] configuration() throws Exception {
        MavenUrlReference oracleLib = maven()
                .groupId("com.oracle")
                .artifactId("ojdbc6")
                .version("11.2.0")
                .type("jar");

        return new Option[] {
                karafDistributionConfiguration().frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf")
                        .type("zip").version("4.0.1"))
                .unpackDirectory(new File("target/paxexam/unpack/"))
                .useDeployFolder(false),
                KarafDistributionOption.debugConfiguration("8898", true),
                bootClasspathLibrary(oracleLib),
                configureConsole().ignoreLocalConsole(),
                logLevel(LogLevel.INFO),
                keepRuntimeFolder(),

        };
    }