osgi - How to give a repository url in karaf paxexam configuration -
the below code tries install artifacts defined in feature location http://repository.apache.org/content/groups/snapshots-group/ there way give repository location download , install.
@configuration public static option[] configuration() throws exception { return new option[] { karafdistributionoption.debugconfiguration("8889", true), karafdistributionconfiguration().frameworkurl(maven().groupid("org.apache.karaf").artifactid("apache-karaf") .type("zip").version("4.0.3")) .unpackdirectory(new file("target/paxexam/unpack/")) .usedeployfolder(false), configureconsole().ignorelocalconsole(), loglevel(loglevel.info), keepruntimefolder(),provision( mavenbundle() .groupid("test") .artifactid("dbhandler").version("0.0.1-snapshot").classifier("features").start()) }; }
when above code executed getting below error
shaded.org.eclipse.aether.resolution.artifactresolutionexception: not find artifact test:dbhandler:jar:features:0.0.1-snapshot in apache (http://repository.apache.org/content/groups/snapshots-group/) @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.resolve(defaultartifactresolver.java:444)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.resolveartifacts(defaultartifactresolver.java:246)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.resolveartifact(defaultartifactresolver.java:223)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultrepositorysystem.resolveartifact(defaultrepositorysystem.java:294)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.ops4j.pax.url.mvn.internal.aetherbasedresolver.resolve(aetherbasedresolver.java:573)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.ops4j.pax.url.mvn.internal.aetherbasedresolver.resolve(aetherbasedresolver.java:528)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.ops4j.pax.url.mvn.internal.aetherbasedresolver.resolve(aetherbasedresolver.java:506)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.ops4j.pax.url.mvn.internal.aetherbasedresolver.resolve(aetherbasedresolver.java:481)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.apache.karaf.features.internal.download.impl.mavendownloadtask.download(mavendownloadtask.java:34)[9:org.apache.karaf.features.core:4.0.3] @ org.apache.karaf.features.internal.download.impl.abstractretryabledownloadtask.run(abstractretryabledownloadtask.java:58)[9:org.apache.karaf.features.core:4.0.3] @ java.util.concurrent.executors$runnableadapter.call(executors.java:471)[:1.7.0_79] @ java.util.concurrent.futuretask.run(futuretask.java:262)[:1.7.0_79] @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.access$201(scheduledthreadpoolexecutor.java:178)[:1.7.0_79] @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.run(scheduledthreadpoolexecutor.java:292)[:1.7.0_79] @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)[:1.7.0_79] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)[:1.7.0_79] @ java.lang.thread.run(thread.java:745)[:1.7.0_79] caused by: shaded.org.eclipse.aether.transfer.artifactnotfoundexception: not find artifact test:dbhandler:jar:features:0.0.1-snapshot in apache (http://repository.apache.org/content/groups/snapshots-group/) @ shaded.org.eclipse.aether.connector.basic.artifacttransportlistener.transferfailed(artifacttransportlistener.java:39)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.connector.basic.basicrepositoryconnector$taskrunner.run(basicrepositoryconnector.java:355)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.util.concurrency.runnableerrorforwarder$1.run(runnableerrorforwarder.java:67)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.connector.basic.basicrepositoryconnector$directexecutor.execute(basicrepositoryconnector.java:581)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.connector.basic.basicrepositoryconnector.get(basicrepositoryconnector.java:249)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.performdownloads(defaultartifactresolver.java:520)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.resolve(defaultartifactresolver.java:421)[4:org.ops4j.pax.url.mvn:2.4.3] ... 16 more 2016-02-06 00:23:52,754 | warn | pool-10-thread-3 | aetherbasedresolver | 5 - org.ops4j.pax.logging.pax-logging-api - 1.8.4 | error resolving artifacttest:dbhandler:jar:features:0.0.1-snapshot:could not find artifact test:dbhandler:jar:features:0.0.1-snapshot in apache (http://repository.apache.org/content/groups/snapshots-group/) shaded.org.eclipse.aether.resolution.artifactresolutionexception: not find artifact test:dbhandler:jar:features:0.0.1-snapshot in apache (http://repository.apache.org/content/groups/snapshots-group/) @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.resolve(defaultartifactresolver.java:444)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.resolveartifacts(defaultartifactresolver.java:246)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.resolveartifact(defaultartifactresolver.java:223)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultrepositorysystem.resolveartifact(defaultrepositorysystem.java:294)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.ops4j.pax.url.mvn.internal.aetherbasedresolver.resolve(aetherbasedresolver.java:573)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.ops4j.pax.url.mvn.internal.aetherbasedresolver.resolve(aetherbasedresolver.java:528)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.ops4j.pax.url.mvn.internal.aetherbasedresolver.resolve(aetherbasedresolver.java:506)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.ops4j.pax.url.mvn.internal.aetherbasedresolver.resolve(aetherbasedresolver.java:481)[4:org.ops4j.pax.url.mvn:2.4.3] @ org.apache.karaf.features.internal.download.impl.mavendownloadtask.download(mavendownloadtask.java:34)[9:org.apache.karaf.features.core:4.0.3] @ org.apache.karaf.features.internal.download.impl.abstractretryabledownloadtask.run(abstractretryabledownloadtask.java:58)[9:org.apache.karaf.features.core:4.0.3] @ java.util.concurrent.executors$runnableadapter.call(executors.java:471)[:1.7.0_79] @ java.util.concurrent.futuretask.run(futuretask.java:262)[:1.7.0_79] @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.access$201(scheduledthreadpoolexecutor.java:178)[:1.7.0_79] @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.run(scheduledthreadpoolexecutor.java:292)[:1.7.0_79] @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)[:1.7.0_79] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)[:1.7.0_79] @ java.lang.thread.run(thread.java:745)[:1.7.0_79] caused by: shaded.org.eclipse.aether.transfer.artifactnotfoundexception: not find artifact test:dbhandler:jar:features:0.0.1-snapshot in apache (http://repository.apache.org/content/groups/snapshots-group/) @ shaded.org.eclipse.aether.connector.basic.artifacttransportlistener.transferfailed(artifacttransportlistener.java:39)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.connector.basic.basicrepositoryconnector$taskrunner.run(basicrepositoryconnector.java:355)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.util.concurrency.runnableerrorforwarder$1.run(runnableerrorforwarder.java:67)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.connector.basic.basicrepositoryconnector$directexecutor.execute(basicrepositoryconnector.java:581)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.connector.basic.basicrepositoryconnector.get(basicrepositoryconnector.java:249)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.performdownloads(defaultartifactresolver.java:520)[4:org.ops4j.pax.url.mvn:2.4.3] @ shaded.org.eclipse.aether.internal.impl.defaultartifactresolver.resolve(defaultartifactresolver.java:421)[4:org.ops4j.pax.url.mvn:2.4.3] ... 16 more
you can dynamically patch file etc/org.ops4j.pax.url.mvn.cfg
add repositories :
editconfigurationfileput("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories", "http://repo1.maven.org/maven2@id=central, ...")
there repository options too, never used it
Comments
Post a Comment