maven-2

Generating classpath file with Maven

守給你的承諾、 提交于 2020-01-24 10:59:09
问题 I'd like to generate a classpath file from pom.xml dependencies. I need it so during tests I have the classpath of all dependencies (that are later packaged into a bundle) maven-dependency-plugin does not suit me for two reasons: it generates paths to files in the repository, so to use other modules they first need to run install phase for them (I'd like to have paths like /some/root/othermodule/target/classes ) it doesn't include the artifact's own path ( target/classes ), which means I need

How to prevent maven to resolve dependencies in local repository

蹲街弑〆低调 提交于 2020-01-22 18:00:08
问题 Is there a way to tell maven (when doing mvn package , mvn site or ...) not to resolve the dependencies from the local repository? Background of this question: Sometimes I get into problems, when previously cached dependencies (e.g. SomeProject-0.7-ALPHA) are no longer available in the remote repository. In my local build everything still works fine as the dependency has been cached before. As soon as I share my pom with others, they may get into trouble, as they dont have a cached version of

Is there a way to tell maven where to place the artifacts?

时间秒杀一切 提交于 2020-01-22 15:05:30
问题 I am running both maven inside the m2eclipse plugin, windows command line and my cygwin command line. cygwin's bash shell dumps artifacts into the cygwin /home/me/.m2 directory but m2eclipse & windows shell (on vista) uses /Users/me/Documents/.m2 Is it possible to tell the mvn command to use one central .m2 directory ? Thanks 回答1: For Cygwin, create a file called ~/.mavenrc and put the following text inside: MAVEN_OPTS="-Dmaven.repo.local=c:\documents and settings\user\.m2\repository" export

Is there a way to tell maven where to place the artifacts?

房东的猫 提交于 2020-01-22 15:05:25
问题 I am running both maven inside the m2eclipse plugin, windows command line and my cygwin command line. cygwin's bash shell dumps artifacts into the cygwin /home/me/.m2 directory but m2eclipse & windows shell (on vista) uses /Users/me/Documents/.m2 Is it possible to tell the mvn command to use one central .m2 directory ? Thanks 回答1: For Cygwin, create a file called ~/.mavenrc and put the following text inside: MAVEN_OPTS="-Dmaven.repo.local=c:\documents and settings\user\.m2\repository" export

Find classpath maven is using for running testng testcase

空扰寡人 提交于 2020-01-22 13:40:06
问题 what options to maven can I use to determine what classpath maven is running a testng test case with? 回答1: You didn't provide the Maven version, but at least in 3.x (and maybe also 2.x) you can run commands with the -X (debug) option. That way the Test Classpath is printed out before tests are run. mvn test -X 回答2: In general you can find the classpath that maven is using by using the built-in maven dependency plugin and its build-classpath goal. If you want the classpath uses for compiling

How to create maven uber jar which includes dependencies with scope provided

你说的曾经没有我的故事 提交于 2020-01-21 15:27:06
问题 <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <archive> <manifest> <mainClass>com.XXXX.XXXXOfflineApp</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> I have the above code piece to create an jar with dependencies, but in my pom i also have some

Maven release plugin fails when creating tag

有些话、适合烂在心里 提交于 2020-01-21 11:49:07
问题 I'm trying to use Maven release plugin 2.0 to tag the version and hopefully deploy the resulting jar to the repository. I got stuck at release:prepare , getting this cryptic error: [INFO] Checking in modified POMs... [INFO] Executing: cmd.exe /X /C "svn --non-interactive commit --file C:\Users\ME~1\AppData\Local\Temp\maven-scm-950614965.commit --targets C:\Users\ME~1\AppData\Local\Temp\maven-scm-35306-targets" [INFO] Working directory: c:\workspace\release-test-trunk [INFO] Tagging release

Specify archetype for archetype:generate on command line

我是研究僧i 提交于 2020-01-21 10:43:06
问题 I'm generating a Maven archetype for a simple project. I use archetype:generate , and it gives me a list of types of archetypes to generate. I'm pretty sure I want 99: remote -> maven-archetype-quickstart (An archetype which contains a sample Maven project.) I can just enter "99" interactively, but I'm trying to write a blog post. I don't want to tell my readers "search for maven-archetype-quickstart in the hundreds of options", and I know it won't always be number 99. So, how do I specify on

What are all of the Maven Command Line Options?

ぐ巨炮叔叔 提交于 2020-01-20 13:57:45
问题 I'm looking for the list of options for Maven 2.2 but cannot find it. If someone knows the location please post it. Thank you. I found the following but I don't know enough of Maven to know which are and are not in 2.2. Version Maven 3.3.3 CLI Options Reference 回答1: Found this page today. Maven CLI Options Reference. Text version to make it easy to copy/paste Maven CLI Options Reference Options >> Description -am,--also-make >> If project list is specified, also build projects required by the

What are all of the Maven Command Line Options?

假装没事ソ 提交于 2020-01-20 13:57:31
问题 I'm looking for the list of options for Maven 2.2 but cannot find it. If someone knows the location please post it. Thank you. I found the following but I don't know enough of Maven to know which are and are not in 2.2. Version Maven 3.3.3 CLI Options Reference 回答1: Found this page today. Maven CLI Options Reference. Text version to make it easy to copy/paste Maven CLI Options Reference Options >> Description -am,--also-make >> If project list is specified, also build projects required by the