How to set where maven installs plugins? - plugins

I've tried building a project with maven 2.2.1 and received the following error
Notice the "directory cannot be created" - the reason I believe is that D: is a drive that was encrypted by TrueCrypt and is now actually H: (D: remains as a physical drive not accessible through Windows)
How do I make maven try to install the plugin on H: instead of on D:?
C:\dev\some-project>mvn -f uberPom.xml install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Declarations
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
Downloading: http://download.java.net/maven/2/org/apache/maven/plugins/maven-site-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7' in repository maven2-repository.dev.java.net (http://download.java.net/maven/2)
Downloading: http://repo.marketcetera.org/maven/org/apache/maven/plugins/maven-site-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7' in repository internal (http://repo.marketcetera.org/maven)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7' from repository central (http://repo1.maven.org/maven2): Specified destination directory cannot be created: D:\.m2\repository\org\apache\
maven\plugins\maven-site-plugin\2.0-beta-7
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7' from repository central (http://repo1.maven.org/maven2): Specified destination directory cannot be created: D:\.m2\repository\org\apache\
maven\plugins\maven-site-plugin\2.0-beta-7
Downloading: http://download.java.net/maven/2/org/apache/maven/plugins/maven-site-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7' in repository java.net (http://download.java.net/maven/2)
Downloading: http://repo.marketcetera.org/maven/org/apache/maven/plugins/maven-site-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7' in repository internal (http://repo.marketcetera.org/maven)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.apache.maven.plugins:maven-site-plugin
Reason: POM 'org.apache.maven.plugins:maven-site-plugin' not found in repository: Unable to download the artifact from any repository
org.apache.maven.plugins:maven-site-plugin:pom:2.0-beta-7
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
java.net (http://download.java.net/maven/2),
internal (http://repo.marketcetera.org/maven),
maven2-repository.dev.java.net (http://download.java.net/maven/2)
for project org.apache.maven.plugins:maven-site-plugin
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Sat May 21 14:45:51 IDT 2011
[INFO] Final Memory: 2M/46M
[INFO] ------------------------------------------------------------------------

You can set the location of your local repository to a different folder by modifying the global settings file (located in \conf\settings.xml). Any plugins and artifacts would then be installed/downloaded to that location.
The following snippet would set the local repository to h:\Maven\repository for example:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>h:\Maven\repository</localRepository>
...

Related

Issue while adding dependency from local file system

Facing issue while adding dependency from local file system.
Am Using systemPath tag to locate dependency.
But jar files is there in the location mentioned.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.citi.166944:retail-basel-services:jar:1.0.0-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for com.citi.163431:ets-ra-tools-aggregate-api:jar should not point at files within the project directory, ${basedir}/external_lib/ets-ra-tools-aggregate-api-1.0.3-JAVA7.jar will be unresolvable by dependent projects # com.citi.166944:retail-basel-services:[unknown-version], C:\Users\jj48521\eclipse-workspace\retail-basel-services-trunk\pom.xml, line 38, column 16
[WARNING] 'dependencies.dependency.systemPath' for com.citi.163431:jrace-util:jar should not point at files within the project directory, ${basedir}/external_lib/jrace-util-1.17-basic-alpha-2.jar will be unresolvable by dependent projects # com.citi.166944:retail-basel-services:[unknown-version], C:\Users\jj48521\eclipse-workspace\retail-basel-services-trunk\pom.xml, line 232, column 16
[WARNING] 'dependencies.dependency.systemPath' for com.citi.163431:jrace-params:jar should not point at files within the project directory, ${basedir}/external_lib/jrace-params-1.17-basic-alpha-2.jar will be unresolvable by dependent projects # com.citi.166944:retail-basel-services:[unknown-version], C:\Users\jj48521\eclipse-workspace\retail-basel-services-trunk\pom.xml, line 239, column 16
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin # com.citi.166944:retail-basel-services:[unknown-version], C:\Users\jj\eclipse-workspace\retail-basel-services-trunk\pom.xml, line 266, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Retail Basel Services 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-jar-plugin:jar:2.3.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.456 s
[INFO] Finished at: 2018-10-08T12:00:28+05:30
[INFO] Final Memory: 8M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-jar-plugin:2.3.1 or one of its dependencies could not be resolved: Cannot access citicore-plugins (http://sdfg.net:8081/nexus/content/repositories/citicore) in offline mode and the artifact org.apache.maven.plugins:maven-jar-plugin:jar:2.3.1 has not been downloaded from it before. -> [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/PluginResolutionException

When trying to install jar in local repository using maven

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

failure on building eclipse platform build 'R4_4_maintenance' and latest 'master' branch

I am trying to build eclipse platform from the source downloaded from 'git clone -b master --recursive git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.aggregator.git'.
I have followed this instruction 'http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html#eclipsegerritcontribution_pushconfig' and tried two builds on 'R4_4_maintenance' and 'master' branch.
Both have got the following failure, anybody knows why? I have build them on ubuntu 13.10 with java 8, maven3.2.1
[INFO]
[INFO] --- tycho-surefire-plugin:0.21.0:test (default-test) # org.eclipse.ui.monitoring.tests ---
[INFO] Cannot complete the request. Generating details.
[INFO] Cannot complete the request. Generating details.
[INFO] {osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86}
[ERROR] Cannot resolve project dependencies:
[ERROR] You requested to install 'bundle org.eclipse.equinox.launcher 0.0.0' but it could not be found
[ERROR]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:

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