-
1. Re: Using our artifactory instead of the Fuse maven repo
grgrzybek Oct 25, 2016 2:44 AM (in response to djbza1)Hello
In standalone mode, all maven access is performed using pax-url-aether library. In fabric mode, the same happens via fabric-maven.
There's much new information about Maven in official Fuse docs, but also you can check:
- http://ggrzybek.blogspot.com/2016/07/using-maven-with-osgi-part-1.html (Aether information)
- http://ggrzybek.blogspot.com/2016/07/using-maven-with-osgi-part-2.html (Configuration of pax-url-aether)
- http://ggrzybek.blogspot.com/2016/10/using-maven-with-osgi-part-3.html (SNAPSHOT handling)
To give you a quick summary, if you want to add your external Artifactory server (actually it's recommended approach if you have several fabric containers), please add its URL to io.fabric8.agent PID, org.ops4j.pax.url.mvn.repositories property. You can add it via hawtio or using OSGi command:
profile-edit --pid io.fabric8.agent/org.ops4j.pax.url.mvn.repositories=http://my.artifactory.com:PORT/xyz default
you can also use --append option for the above command, but actually it's better to use hawtio - you can adjust the default settings to your needs.
regards
Grzegorz Grzybek
-
2. Re: Using our artifactory instead of the Fuse maven repo
djbza1 Oct 26, 2016 6:00 AM (in response to grgrzybek)Thanks Grzegorz,
but I'm still getting an error.
I've added my artifactory repos
org.ops4j.pax.url.mvn.repositories= \
http://repo1.maven.org/maven2@id=maven.central.repo, \
http://repository.jboss.org/nexus/content/repositories/public@id=jboss.public.repo, \
https://repo.fusesource.com/nexus/content/repositories/releases@id=fusesource.release.repo, \
https://repo.fusesource.com/nexus/content/groups/ea@id=fusesource.ea.repo, \
http://svn.apache.org/repos/asf/servicemix/m2-repo@id=servicemix.repo, \
http://repository.springsource.com/maven/bundles/release@id=springsource.release.repo, \
http://repository.springsource.com/maven/bundles/external@id=springsource.external.repo, \
http://10.20.2.21:8081/artifactory/libs-release, \
http://10.20.2.21:8081/artifactory/libs-snapshot, \
http://10.20.2.21:8081/artifactory/all-local, \
http://10.20.2.21:8081/artifactory/plugins-release, \
http://10.20.2.21:8081/artifactory/plugins-snapshot, \
http://10.20.2.21:8081/artifactory/plugins-release
But it still just searches the local repos. Doesn't bother with mine.
The log:display says:
java.io.IOException: Error resolving artifact my.company:authorizationService:jar:4.0.2: Could not find artifact my.company:authorizationService:jar:4.0.2 in karaf-default (file:/opt/fuse/system/)
and hawtio has a similar, but URL style error:
Caused by: java.io.IOException: Error resolving artifact my.company:authorizationService:jar:4.0.2: Could not find artifact my.company:authorizationService:jar:4.0.2 in repo_1511216736 (http://10.20.30.46:8181/maven/download/)
It's just ignoring my remote repo settings?
Any idea?
Thanks
Daniel
-
3. Re: Using our artifactory instead of the Fuse maven repo
grgrzybek Oct 26, 2016 8:08 AM (in response to djbza1)Hello Daniel
io.fabric8.agent PID and org.ops4j.pax.url.mvn.repositories property is used by fabric-agent to provision the container.
The list of remote repositories from this property is prepended with a list of fabric-mavaen-proxy repositories that registered itself in ZooKeeper registry. So agent actually first asks fabric-maven-proxy (you can see its url in the error message: "Could not find artifact my.company:authorizationService:jar:4.0.2 in repo_1511216736 (http://10.20.30.46:8181/maven/download/)").
That means that the fabric-maven-proxy can't find the artifact. You can always try invoking:
curl -v http://10.20.30.46:8181/maven/download/my/company/authorizationService/4.0.2/authorizationService-4.0.2.jar
fabric-maven-proxy uses relevant configuration from io.fabric8.maven PID and io.fabric8.maven.repositories property, which by default points to io.fabric8.agent PID and org.ops4j.pax.url.mvn.repositories property - but please check it.I suggest increasing Maven-related logging as well:profile-edit --pid org.ops4j.pax.logging/log4j.logger.org.eclipse.aether=TRACE karaf profile-edit --pid org.ops4j.pax.logging/log4j.logger.org.apache.http.headers=DEBUG karaf profile-edit --pid org.ops4j.pax.logging/log4j.logger.io.fabric8.maven.util=TRACE karaf profile-edit --pid org.ops4j.pax.logging/log4j.logger.io.fabric8.maven.url=TRACE karaf profile-edit --pid org.ops4j.pax.logging/log4j.logger.io.fabric8.agent.download=DEBUG karaf
this way you'll see in logs which repositories are actually being contacted.
regards
Grzegorz Grzybek