maven-2

Setting the a Property to what maven.compile.classpath Contains WITHOUT Ant

我们两清 提交于 2019-12-21 03:58:11
问题 I'd like to set a property in my pom to a classpath containing all the project's dependencies. The ant plugin does something like this, so I know it's definitely possible. I basically want to use ${maven.compile.classpath} wherever I like in my pom and have it 'just work'. I don't mind using plugins or anything else to achieve this. Many thanks, Nick 回答1: I don't think that there's a way of doing this without writing your own maven plugin. That said, you can get at the classpath using

How do you use Maven to share source code for two projects?

…衆ロ難τιáo~ 提交于 2019-12-21 03:33:36
问题 I have a large Java Web Application project using Maven and I need to start a new project that will share most of the same code (so I don't have to repeat work), but not all of it. I'm going to copy the shared code into a new project (let's call it "root"). How do I make my original Project depend on root for source code? I can't just jar it because I want to change the source before compiling. 回答1: You should refactor your projects. Identify the common code Extract that into its own maven

JPA 2.0 API maven artifact

 ̄綄美尐妖づ 提交于 2019-12-21 03:12:50
问题 I am using JPA 2.0 and my persistence provider is Hibernate; however, I'd like to just include a standard API from javax, but in central, there is no 2.0 artifact. I am currently using the Hibernate JPA 2.0 artifact, but I'd like to use something more standard. Is this possible? Thanks, Walter 回答1: I am currently using the Hibernate JPA 2.0 artifact, but I'd like to use something more standard There is still no javax.persistence:persistence-api:jar:2.0 artifact from Sun/Oracle. Either use the

Maven findbugs:check - Output Summary Of Bugs

房东的猫 提交于 2019-12-20 23:30:26
问题 Does anybody know how to configure the maven findbugs plugin to output a summary of the bugs to the console (similar to the pmd plugin)? At present findbugs:check just prints out how many bugs there are in total and I need to check the individual modules target/findbugs directory and each findbugs.xml file to fix the issues. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>2.0.1</version> <configuration> <xmlOutput>true</xmlOutput>

Running resource filters when using jetty:run

跟風遠走 提交于 2019-12-20 20:28:19
问题 I'm using resource filtering on jsps, based on profiles. I'm also developing locally using mvn jetty:run , but the filtering phase does not run. How can I perform filtering using the jetty plugin? Configuration snippets : <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.0.2</version> <configuration> <webResources> <resource> <directory>src/main/webapp</directory> <includes> <include>error.jsp</include> </includes> <filtering>true<

Maven won't run tests

折月煮酒 提交于 2019-12-20 20:03:36
问题 When running mvn test maven won't run all Test Classes. When I explicitly provide a class by adding -Dtest=PropertyTests the tests will be run. Here's my pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>example<

Maven won't run tests

倾然丶 夕夏残阳落幕 提交于 2019-12-20 20:03:14
问题 When running mvn test maven won't run all Test Classes. When I explicitly provide a class by adding -Dtest=PropertyTests the tests will be run. Here's my pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>example<

weird problem with JAVA_HOME and maven dependencies

旧城冷巷雨未停 提交于 2019-12-20 18:01:35
问题 I have JAVA_HOME variable set to C:\Program Files\Java\jre6\ when I run maven package on the project it tells me that it can't resolve dependency [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.0:compile (default) on project roo: Execution default of goal o rg.codehaus.mojo:aspectj-maven-plugin:1.0:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.0 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.4.2 at

How to merge wars into one?

与世无争的帅哥 提交于 2019-12-20 12:34:17
问题 In our company, we have a number different modules constructed as separate wars. Each client can pick and choose module he wishes to buy. Since all modules share same session, security context etc, it makes sense to merge them into a single war. Is it possible to automate this process? For example, it should merge web.xml, calculate each wars dependencies, copy files like .jsp and .class etc. By the way, we are using Maven, but were not able to find a solution to this problem. 回答1: Granted

Maven won't run my Project : Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec

一世执手 提交于 2019-12-20 12:34:02
问题 I can't run the Maven Netbeans JavaFX example : Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project mavenproject3: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1] To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging. My POM looks like this : <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001