Forum Home » Fuse Distributions » Fuse ESB

Thread: FUSE features:install does not use Maven settings.xml for 'mvn:' protocol

 
This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Last Post: Mar 12, 2010 12:10 PM Last Post By: njiang
jwebb

Posts: 3
Registered: 02/02/10
FUSE features:install does not use Maven settings.xml for 'mvn:' protocol
Posted: Feb 2, 2010 4:12 PM
 
  Click to reply to this thread Reply
Attachment output.txt (439 bytes)
Attachment features.xml (569 bytes)
Attachment settings.xml (701 bytes)
FUSE ESB Version: 4.1.0.2

I am currently trying to install a feature using a custom feature file. The feature file references bundles using the 'mvn:groupId/artifactId/version[/type]' protocol. This works perfectly locally when I have run 'mvn install' successfully and the required artifacts are in my '${user.home}/.m2/repository'. These artifacts are deployed to our internal Nexus server as part of our continuous integration build.

When I try to use the same features file on our test FUSE server (which does not have the artifacts locally in it's .m2 repository), the builds fails as expected because it cannot find the bundles. We have tryed a couple things:
  • Adding our Nexus repository into our ${user.home}/.m2/settings.xml
  • Adding our Nexus repository into our ${M2_HOME}/conf/settings.xml

We tryed the two things mentioned above because of the way artifact resolution is described in the MVN protocol spec. Both of the above settings did work properly when using mvn from the command line to build projects with dependencies only available in our Nexus.

I also found a Feature install behind a firewall? someone was having related to using a proxy in their settings.xml file and it wasn't being utilized by FUSE through the mvn: protocol in a custom feature. His issue was resolved by what appears to be magic because he claims "it just started working". Unfortunately, I have not been so lucky. Any information or tips on other things I could try would be greatly appreciated!

settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>defaultProfile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>nexus</id>
<name>Point2 Nexus Snapshot Repo</name>
<url>http://nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
</profile>
<profile>
<id>local</id>
<properties>
<fuse.home>C:\progress\fuse-esb-4.1.0.2</fuse.home>
</properties>
</profile>
</profiles>
</settings>


features.xml

<?xml version="1.0" encoding="UTF-8"?>
<features>
<feature name="public-engine" version="1.0.0">
<feature version="1.6.1.0-fuse">camel-mail</feature>
<feature version="1.6.1.0-fuse">camel-jms</feature>
<feature version="1.6.1.0-fuse">camel-quartz</feature>
<feature version="1.6.1.0-fuse">camel-ftp</feature>
<feature version="1.6.1.0-fuse">camel-velocity</feature>
<bundle>mvn:com.mydomain.syndication/engine/1.0.0-SNAPSHOT</bundle>
<bundle>mvn:com.mydomain.syndication/engine-web/1.0.0-SNAPSHOT/war</bundle>
</feature>
</features>

FUSE console output

smx@root:features> addUrl file:E:/mydomain/trunk/syndication/scripts/features.xml
smx@root:features> list | grep public
uninstalled http:// 1.0.0 public-engine
smx@root:features> install public-engine
ERROR CommandLineExecutionFailed: org.apache.geronimo.gshell.command.CommandException: java.lang.RuntimeException:
URL mvn:com.mydomain.syndication/engine/1.0.0-SNAPSHOT could not be resolved. (enable TRACE logging for details)-----


Edited by: jwebb on Feb 2, 2010 4:19 PM
- Sorry for bad formatting; attaching files for better readability.
jwebb

Posts: 3
Registered: 02/02/10
Re: FUSE features:install does not use Maven settings.xml for 'mvn:' protocol
Posted: Feb 3, 2010 2:57 PM   in response to: jwebb in response to: jwebb
 
  Click to reply to this thread Reply
We resolved our issue late yesterday. Here is what we changed to make Maven use our internal repositories...

We modified the ${FUSE_HOME}/etc/org.ops4j.pax.url.mvn.cfg file:
- Found the 'org.ops4j.pax.url.mvn.repositories' list of repos
- Added our two internal repositories:

http://nexus/content/repositories/snapshots@snapshots@noreleases,http://nexus/content/repositories/releases

This forced our FUSE server to check our Nexus server when it attempts to resolve mvn: protocol URIs.
rand1

Posts: 7
Registered: 03/09/10
Re: FUSE features:install does not use Maven settings.xml for 'mvn:' protocol
Posted: Mar 9, 2010 8:36 PM   in response to: jwebb in response to: jwebb
 
  Click to reply to this thread Reply
Thanks for the response, this solved our issues as well.
some.java.devel...

Posts: 15
Registered: 03/09/10
Re: FUSE features:install does not use Maven settings.xml for 'mvn:' protocol
Posted: Mar 10, 2010 9:57 AM   in response to: jwebb in response to: jwebb
 
  Click to reply to this thread Reply
My point exactly in the post:

http://fusesource.com/forums/thread.jspa?threadID=1708

Also I don't know how nexus responds to the url's with the @ signs in the url's.
Did you add url's like:

http://repository.apache.org/content/groups/snapshots-group@snapshots@noreleases

Does this work in Nexus (we are using version 1.4.1 open source edition)?
Same thing for the url:
http://repository.springsource.com/maven/bundles/release
I don't get any response with my web browser from this one.
rand1

Posts: 7
Registered: 03/09/10
Re: FUSE features:install does not use Maven settings.xml for 'mvn:' protocol
Posted: Mar 10, 2010 2:32 PM   in response to: some.java.devel... in response to: some.java.devel...
 
  Click to reply to this thread Reply
We also use nexus. Our settings.xml <mirrors> all traffic to:
http://<host>/nexus/content/groups/public

Simply assigning this url to the value of the org.ops4j.pax.url.mvn.repositories property does the trick.
some.java.devel...

Posts: 15
Registered: 03/09/10
Re: FUSE features:install does not use Maven settings.xml for 'mvn:' protocol
Posted: Mar 11, 2010 3:02 AM   in response to: rand1 in response to: rand1
 
  Click to reply to this thread Reply
I agree that you can use a Nexus server for the features, but do url's like:

http://repository.apache.org/content/groups/snapshots-group@snapshots@noreleases

actually contribute to any content in the nexus server.
If you added this repository to your nexus server, can you see any content in the index of this repository if you login to the Nexus console?

If i check out url's like this with my web browser, then I get a page not found. So my guess is that url's like this should not be added to the Nexus server.

Can you confirm that you added such url's to the nexus repositories and that there is effectively content in that repository on Nexus?

Regards,
ccustine

Posts: 48
Registered: 11/14/07
Re: FUSE features:install does not use Maven settings.xml for 'mvn:' protocol
Posted: Mar 11, 2010 8:57 AM   in response to: some.java.devel... in response to: some.java.devel...
 
  Click to reply to this thread Reply
The @noreleases and @snapshots are not actually used in the request. These are just hints to the maven url handler to help limit the number of requests to that repository url. So in other words, @snapshots tells the url handler that it can try this repository if the requested mvn: url is a snapshot version. The default behavior mimics maven itself, so if you just have a repository url without any hints, it will be considered to only have released artifacts (no -SNAPSHOT in the version). So if you have a repository that is ONLY a snapshot repository, you add @noreleases@snapshots to the repository url.

You can find more documentation on the pax mvn url handler and the configuration properties on this page.
some.java.devel...

Posts: 15
Registered: 03/09/10
Re: FUSE features:install does not use Maven settings.xml for 'mvn:' protocol
Posted: Mar 11, 2010 12:37 PM   in response to: ccustine in response to: ccustine
 
  Click to reply to this thread Reply
Thank you very much for these explanations.

I also noticed that the modifications in the org.ops4j.pax.url.mvn.cfg are not copied to the child instances that are created on the console.
Is this the normal behaviour?

Regards,
njiang

Posts: 572
Registered: 09/17/07
Re: FUSE features:install does not use Maven settings.xml for 'mvn:' protoc
Posted: Mar 12, 2010 12:10 PM   in response to: some.java.devel... in response to: some.java.devel...
 
  Click to reply to this thread Reply
There is an issue of copying the configure file when using admin:create a new instance in Karaf.
You can work around it by copy the file manually.