What is the correct URL to make available the FAB feature in karafe? - apache-servicemix

At http://fuse.fusesource.org/bundle/faq.html#How_do_I_enable_FAB_support_in_my_OSGi_container_, we are instructed to do:
features:addUrl mvn:org.fusesource.fuse/fuse-fuse/7.0.1.fuse-084/xml/features
features:install fuse-bundle
in karafe to enable FAB. This results in:
Could not add Feature Repository:
java.lang.RuntimeException: URL [mvn:org.fusesource.fuse/fuse-fuse/7.0.1.fuse-084/xml/features] could not be resolved.
Please verify that the feature repository URL is correct and that your network connection works fine.
Can anybody advise us as to what URL we should use and where to find such information on an ongoing basis? Also, where, more generally, is the official place to look for such documentation. I have not found RedHat's stewardship terribly helpful in that regard.
thanks

You need to add the maven repository to your Apache Karaf configuration file. See the etc directory, there is a file org.ops4j.pax.url.mvn.cfg where you add the fusesource repo where the FAB distribution is.
Notice that its much easier to use JBoss Fuse or Fuse ESB Enterprise, as they have FAB enabled out of the box.
The repo url is: http://repo.fusesource.com/nexus/content/repositories/releases
So in etc/org.ops4j.pax.url.mvn.cfg file you add this line to the repos in the bottom of the file:
http://repo.fusesource.com/nexus/content/repositories/releases#id=fusesource.release.repo, \

Related

maven directory not found in Jenkins?

I am doing auto deployment of Java Application using Maven and Jenkins, but it is getting failed.Here is the console output:
I have set the environment varaibles and also downloaded and configure all the required plugins. Need help to solve this issue.
Thanks
First of all: Please copy/paste messages instead of using images.
Secondly, the message said that you probably misconfigured the directory for the settings.xml. The settings.xml is usually in the directory .m2 in the user directory, but it can also be supplied from somewhere else.

Build Error while building aperturejs

I am trying to build aperturejs with Readme.md instructions.
I cloned the repository and tried the command mvn clean install in the root directory of ApertureJs.
I got the following Build Error as in the screenshot,
I am using the latest version of Maven - 3.3.9
Thanks in advance.
By reading the error in your console, I could feel that you are not authorized to access the particular repository, which is shown in your console.
Copy the repository url and try it from a browser - hope you will not be able to access the repository, since you are not authorized.
Raise appropriate access and after getting access, then try mvn clean install.
Below is the Quick fix till the time you get the access:
Copy and Paste the respective jar/pom/folder from your colleague machine, in your .m2/repository/...
Run the mvn clean install with -o option so that it will look into your local repository for building your application
Thank you. The issue is solved. I posted this issue to Uncharted Software's Salt Repository and exactly like Clement Said, I was trying to access a repository that no more has access publicly. Therefore they gave a workaround.
It is available here -> https://github.com/unchartedsoftware/aperturejs/issues/22
Thanks a lot.

How to setup a proxy for Apache Karaf

Simple one but unable to find anything solid on google. I am running Karaf and I am behind a proxy. I need to add some features to the container by executing the following command:
features:addurl mvn:org.apache.camel.karaf/apache-camel/2.9.0/xml/features
When I do this I get the following exception:
Could not add Feature Repository:
java.lang.RuntimeException: URL [mvn:org.apache.camel.karaf/apache-camel/2.9.0/xml/features] could not be resolved.
This appears to be a proxy authentication issue. Please note I have added proxy information to Maven and I can download dependencies in Maven. I suspect I need to add some information like http.proxyName or http.Proxyxxx to one of the files in the etc directory of the Karaf installation.
Any ideas out there?
UPDATE:
I have found a setting in the org.ops4j.pax.url.mvn.cfg which is
org.ops4j.pax.url.mvn.proxySupport=true
I have uncommented this but I still cant authenticate. So I suspect I need to set my maven home folder somewhere.
UPDATE 2:
Ok very simple thing to do:
In your Apache karaf folder there is a etc folder. Edit the org.ops4j.pax.url.mvn.cfg file. You need to perform two steps for it to work.
Point karaf to your maven installation: find the following string in your cfg file org.ops4j.pax.url.mvn.settings uncomment it and add your maven home path i.e. org.ops4j.pax.url.mvn.settings= /maven/conf/settings.xml
Tell karaf to use the maven proxy settings: find the following string in your cfg file org.ops4j.pax.url.mvn.proxySupport uncomment it and set it to true if needs be i.e. org.ops4j.pax.url.mvn.proxySupport=true
I restarted Karaf and I can now download/install features. I hope this helps someone someday.
So if you follow my post above you will see the two main steps in getting Karaf to work via a proxy. I am not sure if there is anything more to it so I am willing to listen to other answers. But in short edit the org.ops4j.pax.url.mvn.cfg file to point to your maven install and maven proxy settings.
If a local maven instance is not available the below configurations will help :
Java proxy settings will resolve this issue:
-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=80
In my case, i am using Karaf-Wrapper(http://karaf.apache.org/manual/latest-2.3.x/users-guide/wrapper.html) and adding the below settings in etc/KARAF-wrapper.conf worked!!
wrapper.java.additional.10=-Dhttp.proxyHost=127.0.0.1
wrapper.java.additional.11=-Dhttp.proxyPort=80
Note: With this option the web services are also exposed via proxy, so if you want to avoid it, once the purpose is achieved you will have to turn off the proxy.

How to index a Maven repo without Nexus/Artifactory/etc?

I run my own little Maven repo for some open source. I have no dedicated server so I use a Google code repository, deploy to file system and then commit and push. Works perfect for me.
But some Maven tools are looking for a nexus-maven-repository-index.properties and the index (in GZ). I would like to generate this index to
get rid of the warning that it's not here
Maven doesn't try the repo for artefacts that are not there.
How can I do that? Is there a tool (Java main) that is able to generate an index? Also tips how to use the proper Nexus Jars with a little commandline tool are welcome.
I came across this post while I was searching for a solution to add a local repository to my Maven project using IntelliJ Idea.
Since Sonatype changed their paths and reorganized the downloads since the last post, here is an updated step-by-step tutorial to get your repository indexed for use with IntelliJ Idea:
Download the latest stand-alone indexer from here.
Extract it somewhere and go into this directory
From the console, run this command: export REPODIR=/path/to/your/local/repo/ && java org.sonatype.nexus.index.cli.NexusIndexerCli -r $REPODIR -i $REPODIR/.index -d $REPODIR/.index -n localrepo
In the directory .index within the repository directory, some files will be created including the file "nexus-maven-repository-index.gz" which is the file IntelliJ looks out for.
You can use the Maven Indexer CLI to product the index directly, but why bother hosting your own repo when OSS projects can use a hosted one for free?
http://nexus.sonatype.org/oss-repository-hosting.html
I was looking at maven indexer... but I am not sure what for is the last parameter indexDir in the method:
public RepositoryIndexer createRepositoryIndexer(String repositoryId,
File repositoryBasedir,
File indexDir)
is it like starting point in the repositoryBasedir?

How do I set where my grails plugins should be installed?

I saw the light and install the joda-time plugin for grails.
However, when I tried to commit my changes to source control I realised that grails had located the files in:
C:\Users\Steve\.grails\1.1.1\plugins
instead of somewhere under the project directory of:
f:\grails\projects\myproject
Yeah I'm using windows :-\
So now when someone pulls down my changes from source control they are missing all the joda-time plugin lovelyness and they are wanting to spank me :)
What should I be setting so that grails doesn't put anything under my user directory?
(It isn't installed as a global plugin - just as a project one - at least I think so, I ran "grails install-plugin joda-time" )
Many thanks in advance.
P.S. Currently listening to Plug In Baby by Muse....how coincidental :D
The plugin is listed in application.properties, so when someone gets your code Grails will install missing plugins the first time they run 'grails run-app' or other commands.
If you want to revert to 1.0.x behavior just create grails-app/conf/BuildConfig.groovy with the line
grails.project.plugins.dir='plugins'
and your plugins will be in with the rest of the project files.

Resources