maven-2

Maven/Surefire not finding unit tests

落爺英雄遲暮 提交于 2019-12-01 12:04:27
I tried creating a test project with maven and the unit testing worked fine. However, when trying to do the same for a j2ee project, the unit tests cannot be found by surefire. The tests are in the correct directory (src/test/java) and they are being compiled. The junit test is at src/test/java/unit/TestAddition.java The surefire plugin config in pom.xml does not include/exclude any files. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.8</version> </plugin> and junit, testng <!-- Testing dependencies --> <dependency> <groupId

Maven/Surefire not finding unit tests

*爱你&永不变心* 提交于 2019-12-01 12:01:41
问题 I tried creating a test project with maven and the unit testing worked fine. However, when trying to do the same for a j2ee project, the unit tests cannot be found by surefire. The tests are in the correct directory (src/test/java) and they are being compiled. The junit test is at src/test/java/unit/TestAddition.java The surefire plugin config in pom.xml does not include/exclude any files. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId>

Managing maven dependancies - New Versions and Non-Repo libraries

允我心安 提交于 2019-12-01 11:49:22
问题 Warning : I have just picked up Maven, so things mentioned might be wrong or not best practice. I have a medium size open source project that I am migrating to Maven from the basic NetBeans project management. This is not a developer team sharing the same room, this is 1-5 people over the internet sharing a SVN repo. Reading over the how-tos on dependencies, it seems that the only way to get dependencies is to get them from an online repo or install them locally. This is not what I was

How to find out what jar file provides a class during runtime using maven?

落花浮王杯 提交于 2019-12-01 11:36:25
I run my application using mvn jetty:run At compile time everything is fine, my row Tidy tidier = new Tidy(); tidier.setInputEncoding("UTF-8"); compiles fine and the classpath shows the appropriate jar. However, at runtime I get the following exception and I cannot undestand why: 2009-11-11 17:48:53.384::WARN: Error starting handlers java.lang.NoSuchMethodError: org.w3c.tidy.Tidy.setInputEncoding(Ljava/lang/String;)V I am now thinking maybe there are two different versions of this Tidy in my classpath (the one apparently is not named tidy, otherwise I could detect it in the classpath shown by

How to start application in command line with Maven

北城以北 提交于 2019-12-01 11:11:49
I want to run Android application in command line after execution android:deploy maven goal Does Maven have some command which can run application after install ? ihrupin Thanks mschonaker I found the complete solution for Maven First you need to add plugin in your POM <plugin> <artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> <configuration> <executable>${basedir}/scripts/run_app.sh</executable> </configuration> </plugin> add script in ${basedir}/scripts/ dir with next content: adb shell am start -a android.intent.action.MAIN -n your.app.package/.YourMainActivity

Configure Maven plugins to stick together

旧城冷巷雨未停 提交于 2019-12-01 10:47:56
I have parent pom which configures certain plugins <pluginManagement> </plugins> <plugin> <artifactId>gmaven-plugin</artifactId> ... </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> ... </plugin> <plugin> <artifactId>cargo-maven2-plugin</artifactId> ... </plugin> </plugins> </pluginManagement> And I have tree of poms which are represent integration tests A-\ a1 a2 B-\ b1 b2 C-\ D-\ d1 d2 In each a,b,d products I do <build> <plugins> <plugin> <artifactId>gmaven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> </plugin> <plugin> <artifactId

Java Repository of Eclipse with Maven : Missing artifact:compile

白昼怎懂夜的黑 提交于 2019-12-01 08:06:18
I am trying to intigrate jersey-server and the grizzly-servlet-webserver into my Maven Webapp to try a hellworld with JAX-RS . Unfortunately the Jersey and Grizzly dependencies are trouble and not working. I tried deleting the .m2 folder because I thought it might be corrupted which did not help. I added other dependencies like jsoup which works fine. In the log it actually downloads jersey-server from the repository so its not a networking issue. Can anybody help me? I am really stuck! My Eclipse Log: 14.07.11 18:31:33 MESZ: Refreshing [/server/pom.xml] 14.07.11 18:31:33 MESZ: Missing

Configure Maven plugins to stick together

£可爱£侵袭症+ 提交于 2019-12-01 08:06:02
问题 I have parent pom which configures certain plugins <pluginManagement> </plugins> <plugin> <artifactId>gmaven-plugin</artifactId> ... </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> ... </plugin> <plugin> <artifactId>cargo-maven2-plugin</artifactId> ... </plugin> </plugins> </pluginManagement> And I have tree of poms which are represent integration tests A-\ a1 a2 B-\ b1 b2 C-\ D-\ d1 d2 In each a,b,d products I do <build> <plugins> <plugin> <artifactId>gmaven-plugin<

Add the effective pom.xml in the META-INF directory

折月煮酒 提交于 2019-12-01 07:06:03
问题 When I build a JAR library using Maven 2 (version 2.0.9 or 2.2.1 ), the pom.xml of the library is copied in the META-INF/maven/[groupId]/[artifactId]/ directory of the JAR. However, in my case, the pom.xml has a parent, and I would prefer to get the effective-pom instead of the original pom.xml file (or eventually, having both of them). Is there a way to do that? 回答1: You can generate the effective-pom.xml during install cycle <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId

Maven reporting plugins do not execute if a unit test failure occurs

混江龙づ霸主 提交于 2019-12-01 07:03:30
None of the plugins in the reporting section of Maven execute if there is a unit test failure. I found that I can set maven.test.failure.ignore=true here - http://jira.codehaus.org/browse/SUREFIRE-247 The problem to this approach is now our hudson builds are successful even if there are unit test failures. What I would really like to do is set the reporting plugin maven-surefire-report-plugin to run with the build plugins on a phase but I can't get this to work. Any idea on how to get the Maven reporting plugins to execute if a unit test failure occurs? Firstly run : mvn test OR mvn install