1

有没有办法在启动 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(),

        };
    }
4

1 回答 1

1

我找到了解决方案。下面的代码将解决问题

@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(),

        };
    }
于 2016-02-11T06:14:15.467 回答