문제

I'm new to OSGi and Amdatu and I'm using OSGi with Maven.

Usually I import bundles like this sudo mvn pax:import-bundle -DgroupId=org.eclipse.jetty.osgi -DartifactId=jetty-osgi-boot -Dversion=9.1.3.v20140225

In upper case importing works great because the bundle can be found in maven central repository. But there is no amdatu bundle in maven central repository, so I tried to add amdatu repositories in pom.xml.

<repositories>
      <repository>
        <id>dependencies</id>
        <name>Amdatu Dependencies</name>
        <url>http://repository.amdatu.org/dependencies/</url>
    </repository>
    <repository>
        <id>snapshot</id>
        <name>AmdatuSnapshots</name>
        <url>http://repository.amdatu.org/snapshot/</url>
    </repository>
    <repository>
        <id>release</id>
        <name>AmdatuRelease</name>
        <url>http://repository.amdatu.org/release/</
    </repository>
</repositories>

I can see added maven repositories in Netbeans, however when exploring any repository I get the message <No result, processing index...> If I open the link in browser I can see the repository with index.xml file.

So I tried to install a jaxrs bundle and no luck. sudo mvn pax:import-bundle -DgroupId=org.amdatu.web.rest.jaxrs -DartifactId=org.amdatu.web.rest.jaxrs -Dversion=1.0.4

What am I doing wrong? How can I use maven amdatu repository and import bundles?

Thank you!

도움이 되었습니까?

해결책

What you're doing wrong is assuming that the Amdatu repositories are Maven repositories. They are not. They are in fact OSGi Bundle Repositories, and we provide an index in both the "old" (repository.xml) and "new" (index.xml) format.

Within the Amdatu project, we don't use Maven, we develop with Bndtools, so you would have to provide the proper metadata (pom.xml) yourself and then import the bundles into your own Maven repository. If someone would contribute a tool to automatically generate the proper metadata and/or upload artifacts in Maven central, we would be happy to accept that though.

다른 팁

Marcel, thank you for your help.

I have downloaded all bundles and install them in local maven repository with next command.

mvn org.apache.maven.plugins:maven-install-plugin:2.5.1:install-file  -Dfile=path-to-your-artifact-jar \
                                                                      -DgroupId=your.groupId \
                                                                      -DartifactId=your-artifactId \
                                                                      -Dversion=version \
                                                                      -Dpackaging=jar \
                                                                      -DlocalRepositoryPath=path-to-specific-local-repo

I saw that you already found a way to automatically generate pom.xml with BND Tools. https://amdatu.atlassian.net/browse/AMDATU-712

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top