Getting LocalRepositoryNotAccessibleException though mvn is installed - maven

I have installed maven manually through my Mac's(OS- Yosemite) terminal.
The command mvn -version
gives the below output:
> Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06;
> 2015-04-22T17:27:37+05:30) Maven home:
> /Users/shilpa_rajendran/Documents/basicsoft/apache-maven-3.3.3 Java
> version: 1.7.0_71, vendor: Oracle Corporation Java home:
> /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x",
> version: "10.10.4", arch: "x86_64", family: "mac"
But when I do mVn clean , I am getting the below:
[ERROR] Could not create local repository at
/Users/shilpa_rajendran/.m2/repository -> [Help 1] [ERROR] [ERROR] To
see the full stack trace of the errors, re-run Maven with the -e
switch. [ERROR] Re-run Maven using the -X switch to enable full debug
logging. [ERROR] [ERROR] For more information about the errors and
possible solutions, please read the following articles: [ERROR] [Help
1]
http://cwiki.apache.org/confluence/display/MAVEN/LocalRepositoryNotAccessibleException

The culprit was a m2 file which was already present in the location where the .m2 folder gets created usually. Just delete the folder and run your mvn command again.

I believe that your path is not set properly for .m2 folder.
Could not create local repository at /Users/shilpa_rajendran/.m2/repository -> [Help 1]
This is showing that not particular path is found to access or create .m2 folder in Maven.
Step 1) Goto .m2 folder and find setting.xml file
Step 2) Open with administrator cmd (WINDOWS)/ sudo command (LINUX).
Step 3) Open Setting.xml file
Step 4) Find <local-reposirtory>
Step 5) You can see your current path : **/Users/shilpa_rajendran/.m2/repository** .
Step 6) Change that path to current .m2 folder location path.
Thanks
vishal

Related

Error in execution of Maven project in Jenkins

I am getting below errors while executing maven job from Jenkins.I have installed the maven software in Linux and provided the path in global tool configuration section of Jenkins.Error is saying pom.xml file is missing.but I am not getting no clue how to fix this issue.
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/var/lib/jenkins/workspace/JOBS/maventest). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
Also, the output for mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/test/apache-maven-3.6.3
Java version: 1.8.0_131, vendor: Oracle Corporation, runtime: /usr/jdk1.8.0_131/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.14.186-146.268.amzn2.x86_64", arch: "amd64", family: "unix"
value I have set in /etc/profile
export JAVA_HOME=/usr/jdk1.8.0_131
export M2_HOME=/home/test/apache-maven-3.6.3
export M2=$M2_HOME/bin
export PATH=$JAVA_HOME/bin:$M2:$PATH
Please help in fixing this issue.Thanks in advance.

Maven / Tycho build fails requiring 'osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))'

I've installed Xtext 2.19 into Eclipse 2019-06 and created a new skeleton Xtext project.
No changes were done to the generated project but mvn clean install fails with:
[ERROR] Cannot resolve target definition:
[ERROR] Software being installed: org.eclipse.jdt.feature.group 3.18.100.v20190821-1800
[ERROR] Missing requirement: org.eclipse.ant.core 3.5.500.v20190701-1953 requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))' but it could not be found
[ERROR] Cannot satisfy dependency: org.eclipse.ant.ui 3.7.500.v20190518-1030 depends on: osgi.bundle; org.eclipse.ant.core [3.2.0,4.0.0)
[ERROR] Cannot satisfy dependency: org.eclipse.jdt.feature.group 3.18.100.v20190821-1800 depends on: org.eclipse.equinox.p2.iu; org.eclipse.ant.ui [3.7.500.v20190518-1030,3.7.500.v20190518-1030]
[ERROR]
[ERROR] Failed to resolve target definition /home/.../eclipse-workspace/mydsl.parent/mydsl.target/mydsl.target.target: See log for details -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException
Java 12 and Maven 3.6.0 are installed and on the path:
$ java -version
openjdk version "12.0.2" 2019-07-16
OpenJDK Runtime Environment (build 12.0.2+9-Ubuntu-119.04)
OpenJDK 64-Bit Server VM (build 12.0.2+9-Ubuntu-119.04, mixed mode)
$ echo $JAVA_HOME
/usr/lib/jvm/java-12-openjdk-amd64
$ mvn --version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 12.0.2, vendor: Private Build, runtime: /usr/lib/jvm/java-12-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.0.0-25-generic", arch: "amd64", family: "unix"
Since I'm not used to Tycho builds and Eclipse RCP I'm looking for an explanation for what the build is looking for when complaining that the following requirement is not met
osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))
As already stated the Xtext project was generated from scratch using the Xtext Wizard inside of Eclipse so I would assume that all required dependencies are properly configured by default and the build's complain refers to some missing requirement in my build environment / machine - but what exactly is missing?
There is not official Support for Java 12 in Xtext 2.19 (as e.g. Tycho 1.4.0 does not support it). It should work if you use the latest Tycho 1.5.0-SNAPSHOT from
<pluginRepositories>
<pluginRepository>
<id>tycho-snapshots</id>
<url>https://repo.eclipse.org/content/repositories/tycho-snapshots/</url>
</pluginRepository>
</pluginRepositories>
https://wiki.eclipse.org/Tycho/Release_Notes/1.5

Unable to compile and install web karma using maven

I have installed maven successfully and when i check for the Maven version it displays the below information:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:4
7-05:00)
Maven home: C:\Program Files\apache-maven-3.3.9\bin\..
Java version: 1.8.0_73, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_73\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
I have downloaded the Zip folder for Karma and followed the instructions that are mentioned for karma tool installation from the site https://github.com/usc-isi-i2/Web-Karma/wiki/Installation%3A-Source-Code#system-requirements
I have extracted the sip folder to a directory and opened a shell (command prompt) and navigated to the directory where I extracted Karma.On the shell prompt typed mvn clean install
I am getting the below error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
1:compile (default-compile) on project karma-util: Fatal error compiling: direct
ory not found: C:\Program Files\Web-Karma-master\karma-util\target\classes -> [H
elp 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :karma-util
I am not sure where am I wrong. Any help is appreciated.
Previously I was trying in Program Files folder in C drive so I could not install. I changed the folder I am able to install it now.

DSpace 4.x: Error while package building with Maven

I'm trying to install DSpace 4.1 on Ubuntu 14.04, but I'm getting a constant error while attempting to build the installation package with Maven (using mvn package), which is:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.dspace:dspace:4.1
(/home/dspace/dspace-4.1-release/dspace/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.dspace:dspace-parent:4.1:
Failure to find org.sonatype.oss:oss-parent:pom:7 in
http://oss.sonatype.org/content/repositories/releases/ was cached in
the local repository, resolution will not be reattempted until the
update interval of sonatype-releases has elapsed or updates are
forced and 'parent.relativePath' points at no local POM #
org.dspace:dspace-parent:4.1, /home/dspace/dspace-4.1-release/pom.xml,
line 20, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read
the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
I've tried defining a proxy for Maven, I've tried having no proxy for Maven. I tried with both DSpace 4.2 and 4.1. Running mvn clean gets the same error.
I checked the sonatype repository and seemingly the release mentioned by the pom.xml doesn't exist (I didn't make any change to the pom.xml file).
Software info:
OS: Ubuntu 14.04 (Trusty Tahr).
DSpace 4.1, binary release (I've tried with 4.2, binary release, too, but still getting the same error).
Apache Maven 3.0.5.
Try to run mvn package in root folder /home/dspace/dspace-4.1-release/ and not in /home/dspace/dspace-4.1-release/dspace

Maven & JDK 1.7 on Mac

When I try to compile a project with Maven I get the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project webserverlog: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project webserverlog: Compilation failure
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
My JAVA_HOME is pointing to the JDK:
$ echo $JAVA_HOME
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
$ $JAVA_HOME/bin/javac -version
javac 1.7.0_25
javac: no source files
Usage: javac <options> <source files>
I'm not sure why Maven adds '/jre' to the end of JAVA_HOME, but looking at some other posts this doesn't seem to be the problem:
$ mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 18:44:56+1000)
Maven home: /Users/jerry/dev/springsource/apache-maven-3.0.4
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
I've searched for a solution to this problem and tried different things for the last couple of days, but can't find anything that works. I've seen some threads with a similar problem, but none of the suggestions worked for me.
Does anyone know how to solve this? Any help greatly appreciated...
You should assign the real path to the JDK to the JAVA_HOME variable instead of leaving the CurrentJDK literal. For some reason in Mac OS X the CurrentJDK is not pointing to the actual one regarding Maven. Try something like this in your .profile but replacing you actual jdk folder name:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
FYI, one cause of "no source files" is lack of disk space wherever tmp points.
Looks like maven and javac store some items in TEMP/TMP/TMDIR and if that director doesn't exist, lacks space, lacks permissions then you can see that problem. at least we did on windows and I suspect it'll happen on better operating systems too.

Resources