Maven Project in Eclipse - Initial Setup - eclipse

I am trying to follow some existing tutorials on Hadoop that I found online.
I have installed cloudera and am using it as the setup environment for all of the work. However when I try to create a Maven project in Eclipse, I end up having issues referencing to the quickstart archetype.
The error I get is the following:
'Creating maven-archetype-quickstart' has encountered a problem.
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories
The issue seems to be linked with the ~/.m2/ folder. My settings.xml file has been set up per the tutorial and links to the online repositories.
Could not write artifact lastUpdated status /home/cloudera/.m2/repository/org/... (Permission denied)
Please note that I created the whole directory .m2/ as it did not exist. I am running out of ideas, maven is clearly installed on the VM. I am just unsure why everything is referenced back to ~/.m2/ which did not exist and had to be created (and therefore isn't populated).
Whatever help would be appreciated, thanks again for your time!

Related

not able to create maven project

I am not able to create a maven project from eclipse neon/mars.
I have searched for the same problem. There are a couple of suggestions tried from the old threads, but nothing seems to be working.
Could someone please help me how to solve this issue.
Tried the following ways:
window>preferences>Maven>Archetypes>added catalog file as: http://repo1.maven.org/maven2/archetype-catalog.xml
and description as maven catalog
window>preferences>Maven>user settings> under user settings section select the settings.xml file from \conf\settings.xml
but still I get this error:

Maven fixing broken dependencies

I just checked out maven based java project from svn to local box in eclipse where maven 3.0.2 is available. However while reviewing class path configuration many of dependencies are broken such as org.restlet-2.0.15.jar. Strange part is C:/Users/daeyoung/.m2/repository has that broken jar file but .lastUpdated is appended. After reading many posts from WWW, the way I understood to fix the problem is delete *.lastUpdated file then re-download it from central repo.
But when I reviewed pom.xml file there is no mention of repository (strange...) and as soon as I delete *.lastUpdated file, it comes back (e.g. org.restlet-2.0.15.jar.lastUpdated).
I am new to Maven.
I'd appreciate if someone can guide me to a right direction to fix this problem.
[update]
I created following user settings.xml file under /Users/daeyoung/.m2/ directory. I thought at least that would take care of downloading org.restlet package.
However when I ran mvn command (literally mvn) inside of project folder, system was saying..
I don't want to modify pom.xml file but rather via user settings.xml I thought I could connect to maven restlet repo and download specified target package but I am not sure what I am missing in here. I think contents of settings.xml is not correct.
I just want to say thanks to all who have given me advice. First I was not well equipped to understand the advice but more I looked at the problem/read about maven articles. It was clear what needs to be done to fix the problem.
Bottom line is I manually downloaded dependencies to ${user_name}/.m2/repository for missing jars. I configured ${MAVEN_HOME}/conf/settings.xml to point to local repository then I ran mvn validate/clean/package sequentially from eclipse via m2e plugin (or I could have done same thing from command line).

Services bundle not properly getting deployed over Jenkins

I've faced some mystical problem over here. I deploy my Adobe CQ
project over Jenkins and my services package not getting deployed at
all. I mean, they are absent in install folder in my CRXDE. When I am
trying to do the same stuff on localhost with maven manually - it's
working like charm. For some reason, i've noticed in logs, that
services bundle installed, started, then stopped and uninstalled, but
there are no any errors or something. What reason can cause this
issue? I will appreciate any help. Thank you.
Guys, I have found the answer: there was empty "/install" folder in my project structure so when i deploy my packages, 'View' package with empty '/install' folder in it simply rewrites just added 'Services' and 'Taglib' jars from '/install' folder in crxde.
If you delete jar from ../install/ JCR folder, it will be uninstalled from the OSGi as well. I think it may be an issue with the CRX package filters. If you install a few packages, one after another, and they are sharing same paths, then the latter package will delete resources installed by the former one.

Running helloworld-rs from JBoss quickstarts in eclipse

I am trying to learn JAX-RS using JBoss quickstarts.
When I deployed the application "helloworld-rs" through command-line, it ran successfully. Then I created a maven project in Eclipse, copied files from "helloworld-rs" at proper locations and it worked fine. Then I went ahead to add a form to the existing index.html file and something went wrong. Instead off deploying "jboss-as-helloworld-rs", Eclipse started deploying "jboss-as-helloworld-osgi" for some unknown reasons. Obviously, it produced error when I tried to access "localhost:8080/jboss-as-helloworld-rs/index.html"
So I created a new Maven project in Eclipse with following details:
Group Id:org.jboss.as.quickstarts.rshelloworld
Artifact Id: jboss-hello
I have also made changes in pom.xml as follows:
<artifactId>jboss-hello</artifactId>
Still I am facing the same problem. I have made a copy of "helloworld-rs", made same changes in the pom.xml and deployed and ran it successfully through command-line using
http://localhost:8080/jboss-hello/index.html
Strangely, this very link does not work in eclipse!!!
I have zeroed-in that there is some problem in deploying th app in Eclipse. Can anybody please help me solve this? Thank you!!!
I went to the 'jboss-as-7.1.1.Final\standalone\deployments' folder, deleted all the deployed war files. Then in Eclipse, right-click on servers -> clean . Then, I started the JBoss server and everything went fine.

Spring STS can't find META-INF/spring.schemas

Trying to set up a new project, and running into a weird issue. I made a new app context file named backend-context.xml, I've added spring-context as a dependency, and am trying to add namespaces through the bean config file, but it's showing as 1 error, with no explaination.
If I browse into problem explorer, it states the following error:
'Unable to load schema mappings from location [META-INF/spring.schemas]'
If I browse through the Maven Dependencies I can see this file located under the spring-beans jar.
If anyone has ideas on how to fix this, that'd be awesome!
Thanks!
Ended up being caused by a local maven jar being corrupt. Found this out by uploading the code to github and trying on a different computer which worked like a charm. So, cleaned out my local repository from all spring jars and redownloaded.