When trying to install jar in local repository using maven - eclipse

I do not have this SFTP jar in my Nexus Repo & I have add it's dependency into the POM file but now i want to install this JAR in my local repository so that i can use it in my project. But getting access is denied even though i opened command prompt with Administrator rights.
C:\Windows\system32>mvn install:install-file -DgroupId=org.springframework.integration -DartifactId=spring-integration-sftp -Dversion=4.1.5 -Dpackaging=jar -Dfile=C:\Repo
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) # standalone-pom
---
[INFO] Installing C:\Repo to C:\Users\t868396\.m2\repository\org\springframework
\integration\spring-integration-sftp\4.1.5\spring-integration-sftp-4.1.5.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.827 s
[INFO] Finished at: 2015-06-23T11:02:52+05:00
[INFO] Final Memory: 15M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4
:install-file (default-cli) on project standalone-pom: Error installing artifact
'org.springframework.integration:spring-integration-sftp:jar': Failed to instal
l artifact org.springframework.integration:spring-integration-sftp:jar:4.1.5: C:
\Repo (Access is denied) -> [Help 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

Mostly likely the -Dfile=your.jar is not correct, check your argument (FYI it was omitted from your posting).
Here is an example:
mvn install:install-file -DlocalRepositoryPath=repo -DcreateChecksum=true
-Dfile=[your-jar] -Dpackaging=jar
-DgroupId=[...] -DartifactId=[...] -Dversion=[...]
See: Can I add jars to maven 2 build classpath without installing them?
And: https://maven.apache.org/general.html#importing-jars

Related

How to use Maven exec plugin in Eclipse?

I'm new to Maven and I'm trying to run a project with exec:java. My build fails, presumably because I don't have the exec plugin. I downloaded the plugin (http://mvnrepository.com/artifact/org.codehaus.mojo/exec-maven-plugin), but now I don't know what to do with it in order to be able to use it in Eclipse. I tried adding it to the build path, but that didn't seem to work. This may be a very stupid question, but how do I get the plugin to work?
Here's my build output:
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Twitter2 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.4.0:java (default-cli) # Twitter2 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.826 s
[INFO] Finished at: 2015-06-11T14:24:29-06:00
[INFO] Final Memory: 10M/114M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli) on project Twitter2: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java are missing or invalid -> [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/PluginParameterException
As the error says, it seems the mainClass parameter, which tells the plugin what class to run, is not set properly. See http://www.mojohaus.org/exec-maven-plugin/java-mojo.html for the usage of the java goal of the plugin. Try adding the parameter in the POM configuration:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>fully.qualified.class.name</mainClass>
</configuration>
</plugin>
Or via property -Dexec.mainClass=fullClassName in the command line.

do not pass correct settings.xml to Maven Release Plugin

i have the following issue with eclipse , i am running an mvn install ,
try to build my project.
no idea what do with this error
please help
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building superman 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-hpi-plugin:1.95:validate (default-validate) # superman ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0.1:enforce (enforce-maven) # superman ---
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
Build with Maven 3.0.4 or later. Maven 3.0 through 3.0.3 inclusive do not pass correct settings.xml to Maven Release Plugin.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.032s
[INFO] Finished at: Thu Dec 04 11:24:21 CST 2014
[INFO] Final Memory: 22M/355M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0.1:enforce (enforce-maven) on project superman: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [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/MojoExecutionException
That means simply that you are using an older Maven version. Based on the rule you have to use Maven 3.0.5+ that's the problem. The problem with Maven 3.0...3.0.3 had problems with informations from settings.xml to the release plugin which produces problems.
so after all that , you have to go to
window> preferences > maven > installations > and change the settings in there to the new install on your work station . that why eclipse is going to use the new maven 3.2.3
issue solved

I couldn't import 'Existing Maven Projects' of i-jetty

They said,
cd $IJETTY_HOME/console
mvn clean install
This will produce a war file in $IJETTY_HOME/console/webapp/target, and also the apk in $IJETTY_HOME/console/apk/target (although as we mentioned, you're probably not interested in that).
but I got following error (...oh, my god. I can not upload image ;0 )
**
[INFO] --- exec-maven-plugin:1.2:exec (generate-dex) # console ---
Unable to access jarfile ${env.ANDROID_HOME}/platform-tools/lib/dx.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] I-Jetty :: Console Parent ......................... SUCCESS [0.241s]
[INFO] I-Jetty :: Console Webapp ......................... FAILURE [2.431s]
[INFO] I-Jetty :: Console Android Installer .............. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.122s
[INFO] Finished at: Thu Nov 08 19:33:47 KST 2012
[INFO] Final Memory: 14M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (generate-dex) on project console: Command execution failed. Process exited with an error: 1(Exit value: 1) -> [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :console**
and I tried 'Building with Eclipse'
finally, I got following error similar with the one.
on Import Maven Projects,
exec-maven-plugin:1.2:exec (1 errors)
maven-antrun-plugin:1.6:run(1 errors)
maven-depoendency-plugin:2.3:unpack-dependencies(1 error)
Help me, plz.
I installed maven plug-in 1.3 with eclipse on Mac OS X Lion.
finally, I solved it by myself.
I missed export android sdk path (export ANDROID_HOME=/opt/android/android-sdk-linux_86)
and I edited pom.xml
from
<artifactId>maven-android-plugin</artifactId>
<version>2.9.0-beta-5</version>
to
<artifactId>android-maven-plugin</artifactId>
<version>3.0.0</version>
thanks.

Maven: Failed to resolve dependency: C:\Program Files\Java\lib\tools.jar

I'm trying to use the cargo plugin to run a web application in a local Jetty container from inside Eclipse. This seems to be working for other people with the exact same pom.xml, but I get this error:
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.0.3:start (default-cli) on project wsc: Failed to resolve dependency: C:\Program Files\Java\lib\tools.jar -> [Help 1]
How do I resolve this? The project is set to use jdk1.7.0 as the "JRE System Library". I am starting Eclipse with "-vm " and even JAVA_HOME is set to the JDK path.
Any ideas? I've been researching on this for a while and getting crazy about that. The documentation on including tools.jar as dependency didn't help me.
Important: This seems to work outside Eclipse, e.g. with mvn -P local cargo:start.
Program output when started from Eclipse:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Web Services Computing 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.0.3:start (default-cli) # wsc ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.324s
[INFO] Finished at: Sat Oct 22 19:10:18 CEST 2011
[INFO] Final Memory: 15M/107M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.0.3:start (default-cli) on project wsc: Failed to resolve dependency: C:\Program Files\Java\lib\tools.jar -> [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/MojoExecutionException
Dependency tree output (also started from Eclipse):
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) # wsc ---
[INFO] de.tum.ibis.wsc:wsc:war:0.0.1-SNAPSHOT
[INFO] +- junit:junit:jar:3.8.1:test
[INFO] \- javax.servlet:servlet-api:jar:2.5:compile
[INFO] ------------------------------------------------------------------------
You have to start eclipse with a jdk instead of a jre.
If you edit your eclipse.ini and put a jdk to the vm arguments it should work.
-vm
C:/java_1_6/jdk/bin/javaw.exe

Maven Build - Eclipse project meta-data error

I'm trying to create the meta-data for a eclipse project in maven, but my parter and I keep running into the following error, on both our machines. Ive looked around the forum and have tried related advice such as defining a path in the eclipse.ini file and so on, but this hasn't worked. Has anyone else ran into this error before or can see what I am doing incorrectly? Any help would be greatly appreciated.
C:\Users\jheerman\workspace\release\admin-portal>mvn eclipse:clean eclipse:eclip
se -DdownloadSources=true
[INFO] Scanning for projects...
[WARNING] The POM for org.codeaus.mojo:rpm-maven-plugin:jar:2.1-alpha-1 is missi
ng, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.codeaus.mojo:rpm-maven-pl
ugin:2.1-alpha-1: Plugin org.codeaus.mojo:rpm-maven-plugin:2.1-alpha-1 or one of
its dependencies could not be resolved: Failed to read artifact descriptor for
org.codeaus.mojo:rpm-maven-plugin:jar:2.1-alpha-1
[WARNING] The POM for org.codeaus.mojo:rpm-maven-plugin:jar:2.1-alpha-1 is missi
ng, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.codeaus.mojo:rpm-maven-pl
ugin:2.1-alpha-1: Plugin org.codeaus.mojo:rpm-maven-plugin:2.1-alpha-1 or one of
its dependencies could not be resolved: Failed to read artifact descriptor for
org.codeaus.mojo:rpm-maven-plugin:jar:2.1-alpha-1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CTP Admin Portal Services 0.4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.codeaus.mojo:rpm-maven-plugin:jar:2.1-alpha-1 is missi
ng, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.codeaus.mojo:rpm-maven-pl
ugin:2.1-alpha-1: Plugin org.codeaus.mojo:rpm-maven-plugin:2.1-alpha-1 or one of
its dependencies could not be resolved: Failed to read artifact descriptor for
org.codeaus.mojo:rpm-maven-plugin:jar:2.1-alpha-1
[WARNING] The POM for org.codeaus.mojo:rpm-maven-plugin:jar:2.1-alpha-1 is missi
ng, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.codeaus.mojo:rpm-maven-pl
ugin:2.1-alpha-1: Plugin org.codeaus.mojo:rpm-maven-plugin:2.1-alpha-1 or one of
its dependencies could not be resolved: Failed to read artifact descriptor for
org.codeaus.mojo:rpm-maven-plugin:jar:2.1-alpha-1
[INFO]
[INFO] --- maven-eclipse-plugin:2.8:clean (default-cli) # ctp-admin-portal ---
[INFO] Deleting file: .project
[INFO] Deleting file: .classpath
[INFO] Deleting file: .wtpmodules
[INFO] Deleting file: .component
[INFO] Deleting file: org.eclipse.wst.common.component
[INFO] Deleting file: org.eclipse.wst.common.project.facet.core.xml
[INFO] Deleting file: org.eclipse.jdt.core.prefs
[INFO] Deleting file: org.eclipse.ajdt.ui.prefs
[INFO]
[INFO] >>> maven-eclipse-plugin:2.8:eclipse (default-cli) # ctp-admin-portal >>>
[INFO]
[INFO] <<< maven-eclipse-plugin:2.8:eclipse (default-cli) # ctp-admin-portal <<<
[INFO]
[INFO] --- maven-eclipse-plugin:2.8:eclipse (default-cli) # ctp-admin-portal ---
[INFO] Using Eclipse Workspace: C:\Users\jheerman\workspace
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAIN
ER
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.003s
[INFO] Finished at: Thu Jun 23 09:42:31 GMT-08:00 2011
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.8
:eclipse (default-cli) on project ctp-admin-portal: Cant canonicalize system pat
h: {0}: The filename, directory name, or volume label syntax is incorrect -> [He
lp 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