John
John

Reputation: 203

Pax Exam Copy a jar in karaf lib/ext folder

Is there a way to copy a jar in the karaf lib/ext folder while starting the pax-exam

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

        };
    }

Upvotes: 1

Views: 227

Answers (1)

John
John

Reputation: 203

I have found the solution. The below code will fix the issue

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

        };
    }

Upvotes: 1

Related Questions