maven-3

Maven project failed to build

风格不统一 提交于 2019-12-12 15:16:59
问题 I am new to Maven projects. I imported an existing Maven project to eclipse, then made a new configuration. I tried running the application then but the console shows [ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.4:devserver (default-cli) on project helloworld: The plugin com.google.appengine:appengine-maven-plugin:1.9.4 requires Maven version 3.1.0 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR]

Can't build Guava using Maven “mvn package”

主宰稳场 提交于 2019-12-12 15:07:11
问题 I have just read about Guava and checked out its source code but don't know how to build it to use. I built jar file using "mvn package" but it generates errors of Guava GWT. [ERROR] Failed to execute goal on project guava-gwt: Could not resolve dependenc ies for project com.google.guava:guava-gwt:jar:latest: Failure to find com.googl e.guava:guava:jar:sources:latest in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interv

Maven 3 transitive dependencies of test dependency are marked as compile, why?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 13:33:26
问题 I observed a strange behaviour in my maven 3.0.5 / JDK 1.7 build. Within the dependency tree I found TEST -resources that have transitive COMPILE dependencies (see section 1 below). This triggers than in a subsequent build phase that maven-jira-plugin:4.2.20 unpacks these resources to the target/class folder (In effect this is the expected/normal behaviour, but not desired here, see section 2 below) On an other machine, (same Maven/JDK version) these dependencies are not marked as COMPILE and

Accessing the value of eclipse classpath variable M2_REPO in run configuration VM arguments

て烟熏妆下的殇ゞ 提交于 2019-12-12 10:44:36
问题 In the run configuration of eclipse, you are provided with a set of default variables that you can use in the VM arguments, like container_path and env_var . What I want to access is a classpath variable, M2_REPO , but can't see a way of doing this. I need to specify a javaagent in the VM arguments, which requires a path to a jar file. This jar file lives in the maven repository, but I can't find a way of specifying the path to the maven repository using the already configured M2_REPO

Maven release plugin with git, error if commits are pushed during process

不羁的心 提交于 2019-12-12 10:37:37
问题 We use git repository and maven release plugin. In the first build step, we pull all the changes to local repository, and in the next one we run mvn release:prepare release:perform . release:prepare updates workspace, updates version in pom files, creates tag in repository, runs all the tests, builds jars etc. If it's fine, it then pushes local repository changes to remote one (updated poms and tag created). The problem is that when somebody pushes some changes meanwhile, push from maven

How to make maven-compiler-plugin not hide error source locations

我的梦境 提交于 2019-12-12 10:35:55
问题 Maybe there is a maven-compiler-plugin option for this, but I haven't found it. When javac is run directly and prints an error, after the first line of the message, it shows the affected line of source with a caret on the next line pointing to the error position. It looks like this: com/invariantproperties/udt/sql/RationalUDT.java:324: error: cannot find symbol public static boolean lessThan(RRationalUDT p, double q) { ^ symbol: class RRationalUDT location: class RationalUDT Notice the lines

Sharing src/test classes with Maven without version specification for test-jar

末鹿安然 提交于 2019-12-12 09:47:33
问题 I'm sharing src/test classes between number of modules, in a similar way described in attaching tests guide and the following question. So, I have the following pom.xml dependencies: <dependency> <groupId>com.myco.app</groupId> <artifactId>foo</artifactId> </dependency> <dependency> <groupId>com.myco.app</groupId> <artifactId>foo</artifactId> <version>1.0.0-SNAPSHOT</version> <type>test-jar</type> <scope>test</scope> </dependency> BUT , in opposite to the question above, when attaching the

Maven: clean the webapp directory before war:exploded?

依然范特西╮ 提交于 2019-12-12 09:41:00
问题 quoting from maven war plugin usage page : <project> ... <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory> </configuration> </plugin> </plugins> </build> ... </project> How do i clean the content of the directory defined in the <webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory> before

Custom Maven packaging, transitive dependencies aren't included

时光毁灭记忆、已成空白 提交于 2019-12-12 09:36:45
问题 I'm playing around with a custom Maven 3 packaging plugin for some non-java artifacts, and having an issue getting transitive dependencies to work. I've got three projects defined, model , model-impl , and cli , with dependencies like this: cli model-impl model My custom lifecycle plugins are being called in each project, and I can successfully build model and model-impl . For each of those projects, the expected artifacts are being stored in my local repository. cli however is failing

Maven POM file: any rule on ordering of elements and sections?

可紊 提交于 2019-12-12 08:49:24
问题 Concerning the pom.xml Maven file: Is there any specific rule to apply to the ordering of declared sections? Does it have any importance or impact on the build? Shall I follow any official convention? 回答1: Although in most of the cases it is irrevant whether one section is declared before another, readeabilty could be indeed impacted when choosing a weird layout (e.g. Maven coordinates at the end). But that's not the most important point, because yes , ordering of certain elements can impact