|
I have a project that uses the features-maven-plugin to create a new distribution of Karaf. In the configuration of the plugin, I pull in the features for Camel 2.9.1. As shown below:
<plugin> <groupId>org.apache.karaf.tooling</groupId> <artifactId>features-maven-plugin</artifactId> <version>2.2.5</version> <executions> <execution> <id>add-features-to-repo</id> <phase>generate-resources</phase> <goals> <goal>add-features-to-repo</goal> </goals> <configuration> <descriptors> ... <descriptor>mvn:org.apache.camel.karaf/apache-camel/2.9.1/xml/features</descriptor> ... </descriptors> <repository>myDistribution/system</repository> </configuration> </execution> </executions> </plugin> I have an internal Maven repository set up, and in my Maven settings.xml I have specified a Mirror for all repository requests. When I build my project, it resolves most of the dependencies correctly. However, when Maven attempts to resolve some of the dependencies in the Camel features file, it appears to ignore my mirror setting and go straight to the internet to download the dependencies. The lines from the Camel features file that my build has issues with are the following: <bundle dependency='true'>mvn:http://maven.restlet.org!org.restlet.jse/org.restlet/2.0.10</bundle> org/apache/camel/karaf/apache-camel/2.9.1/apache-camel-2.9.1-features.xml: <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-jruby/1.1</bundle> org/apache/camel/karaf/apache-camel/2.9.1/apache-camel-2.9.1-features.xml: <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-javascript/1.1</bundle> org/apache/camel/karaf/apache-camel/2.9.1/apache-camel-2.9.1-features.xml: <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1</bundle> In the Maven build output I see: "Downloading: http://maven.restlet.org/org/restlet/jse/org.restlet/2.0.10/org.restlet-2.0.10.jar." I was expecting to see "Downloading: http://<INTERNAL_REPO>//org/restlet/jse/org.restlet/2.0.10/org.restlet-2.0.10.jar" This only happens for bundles in the feature file that specify an HTTP URL instead of just "mvn:groupId:artifactId:version". Is it expected that the features-maven-plugin would not go through the Maven Mirror in this case? Thanks for the help. |
|
Have you tried with the karaf-maven-plugin from 3.0.0-SNAPSHOT? It's a little tricky to get configured, but it uses Sonatype Aether, so it likely will talk to configured repositories more reliably.
If you want to give it a try, first take a look at [1]. This provides most of what you need for a basic use case. Additionally, I've just posted some additional documentation for the plugin itself that can most easily be seen at [2]. Since I have my head around it at this point, I'm happy to do what I can here to answer questions as well. One of the things I've been doing for my own projects is to make each project generate their own features.xml, then have another project combine them all. It seems to be working pretty well. I have not found any gotchas to using the 3.0.0-SNAPSHOT plugin with the 2.2.x branch of code. [1] https://github.com/apache/karaf/blob/trunk/tooling/karaf-maven-plugin/src/site/apt/usage.apt [2] https://github.com/topping/karaf/commit/5b1bca64adbcbe67ef7248631f128070dbad3642#diff-8 Hope that helps, Brian On Apr 23, 2012, at 8:38 PM, ibarnett wrote: > I have a project that uses the features-maven-plugin to create a new > distribution of Karaf. In the configuration of the plugin, I pull in the > features for Camel 2.9.1. As shown below: > > <plugin> > <groupId>org.apache.karaf.tooling</groupId> > <artifactId>features-maven-plugin</artifactId> > <version>2.2.5</version> > <executions> > <execution> > <id>add-features-to-repo</id> > <phase>generate-resources</phase> > <goals> > <goal>add-features-to-repo</goal> > </goals> > <configuration> > <descriptors> > ... > > <descriptor>mvn:org.apache.camel.karaf/apache-camel/2.9.1/xml/features</descriptor> > ... > </descriptors> > <repository>myDistribution/system</repository> > </configuration> > </execution> > </executions> > </plugin> > > > I have an internal Maven repository set up, and in my Maven settings.xml I > have specified a Mirror for all repository requests. When I build my > project, it resolves most of the dependencies correctly. However, when > Maven attempts to resolve some of the dependencies in the Camel features > file, it appears to ignore my mirror setting and go straight to the internet > to download the dependencies. The lines from the Camel features file that > my build has issues with are the following: > <bundle > dependency='true'>mvn:http://maven.restlet.org!org.restlet.jse/org.restlet/2.0.10</bundle> > org/apache/camel/karaf/apache-camel/2.9.1/apache-camel-2.9.1-features.xml: > <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-jruby/1.1</bundle> > org/apache/camel/karaf/apache-camel/2.9.1/apache-camel-2.9.1-features.xml: > <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-javascript/1.1</bundle> > org/apache/camel/karaf/apache-camel/2.9.1/apache-camel-2.9.1-features.xml: > <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1</bundle> > > In the Maven build output I see: "Downloading: > http://maven.restlet.org/org/restlet/jse/org.restlet/2.0.10/org.restlet-2.0.10.jar." > I was expecting to see "Downloading: > http://<INTERNAL_REPO>//org/restlet/jse/org.restlet/2.0.10/org.restlet-2.0.10.jar" > > This only happens for bundles in the feature file that specify an HTTP URL > instead of just "mvn:groupId:artifactId:version". > > Is it expected that the features-maven-plugin would not go through the Maven > Mirror in this case? > > Thanks for the help. > > > > -- > View this message in context: http://karaf.922171.n3.nabble.com/features-maven-plugin-doesn-t-appear-to-obey-Maven-settings-xml-Mirror-tp3934042p3934042.html > Sent from the Karaf - User mailing list archive at Nabble.com. |
|
This post was updated on .
Thanks for the quick response Brian.
When I had the error, I was on a network that connected to the Internet through a proxy. Even though I had my settings.xml configured correctly, it looks like features-maven-plugin doesn't use Maven's proxy. I have since tried the same build on a proxy-less network, and everything worked. I found a JIRA ticket that confirms this: https://issues.apache.org/jira/browse/KARAF-911. The status of the ticket is still Unresolved and Unassigned. However, I will give the 3.0.0-SNAPSHOT a try to see if there is a chance that it has been fixed. One other bit of information is that features-maven-plugin doesn't seem to go through the mirror either. It appears that if the features file includes a bundle where the location is pointing to an http URL instead of just specifying group ID and artifact ID then the plugin ignores the mirror and goes straight for the URL. I mentioned this earlier, but just wanted to reiterate, as I wouldn't need to go through a proxy if that mirror was read. Thanks again for the suggestion. |
|
In reply to this post by ibarnett
Hi,
it's a "known issue": https://issues.apache.org/jira/browse/KARAF-846 It should be fixed soon. Regards JB On 04/24/2012 02:38 AM, ibarnett wrote: > I have a project that uses the features-maven-plugin to create a new > distribution of Karaf. In the configuration of the plugin, I pull in the > features for Camel 2.9.1. As shown below: > > <plugin> > <groupId>org.apache.karaf.tooling</groupId> > <artifactId>features-maven-plugin</artifactId> > <version>2.2.5</version> > <executions> > <execution> > <id>add-features-to-repo</id> > <phase>generate-resources</phase> > <goals> > <goal>add-features-to-repo</goal> > </goals> > <configuration> > <descriptors> > ... > > <descriptor>mvn:org.apache.camel.karaf/apache-camel/2.9.1/xml/features</descriptor> > ... > </descriptors> > <repository>myDistribution/system</repository> > </configuration> > </execution> > </executions> > </plugin> > > > I have an internal Maven repository set up, and in my Maven settings.xml I > have specified a Mirror for all repository requests. When I build my > project, it resolves most of the dependencies correctly. However, when > Maven attempts to resolve some of the dependencies in the Camel features > file, it appears to ignore my mirror setting and go straight to the internet > to download the dependencies. The lines from the Camel features file that > my build has issues with are the following: > <bundle > dependency='true'>mvn:http://maven.restlet.org!org.restlet.jse/org.restlet/2.0.10</bundle> > org/apache/camel/karaf/apache-camel/2.9.1/apache-camel-2.9.1-features.xml: > <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-jruby/1.1</bundle> > org/apache/camel/karaf/apache-camel/2.9.1/apache-camel-2.9.1-features.xml: > <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-javascript/1.1</bundle> > org/apache/camel/karaf/apache-camel/2.9.1/apache-camel-2.9.1-features.xml: > <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1</bundle> > > In the Maven build output I see: "Downloading: > http://maven.restlet.org/org/restlet/jse/org.restlet/2.0.10/org.restlet-2.0.10.jar." > I was expecting to see "Downloading: > http://<INTERNAL_REPO>//org/restlet/jse/org.restlet/2.0.10/org.restlet-2.0.10.jar" > > This only happens for bundles in the feature file that specify an HTTP URL > instead of just "mvn:groupId:artifactId:version". > > Is it expected that the features-maven-plugin would not go through the Maven > Mirror in this case? > > Thanks for the help. > > > > -- > View this message in context: http://karaf.922171.n3.nabble.com/features-maven-plugin-doesn-t-appear-to-obey-Maven-settings-xml-Mirror-tp3934042p3934042.html > Sent from the Karaf - User mailing list archive at Nabble.com. -- Jean-Baptiste Onofré [hidden email] http://blog.nanthrax.net Talend - http://www.talend.com |
| Powered by Nabble | Edit this page |
