maven-2

How do I configure maven 2's surefire plugin to run Junit 4.5?

依然范特西╮ 提交于 2019-12-05 03:16:39
问题 Maven 2 does not seem to consider my @Test and @Ignore annotations. How do I configure the surefire plugin to run and use the annotations? This question is still not answered. 回答1: I would first configure your master POM to default the surefire plugin to the latest version. This is done by adding an entry to the plugin management section of the POM. For example: <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId>

Passing the Maven Debug Flag from Hudson

喜夏-厌秋 提交于 2019-12-05 03:08:17
I'm having an issue with a maven build in hudson. This issue would be fairly easy to resolve if I could see the output of maven with the -X flag passed in. However I can't find a way to do this. If I specify "-X" in the "Goals and options" field of the "Build" section in the job configuration my console output looks exactly the same as if I had not passed the "-X" flag at all. Is the debug logging going somewhere else? Or is there some other way I need to pass the "-X" flag? UPDATE: The reason this isn't working is because the build is failing during the "Parsing POMs" part of the hudson

How to programmatically build the effective model of a pom file?

那年仲夏 提交于 2019-12-05 02:57:19
问题 I would create programmatically the effective model from a pom file to get all inherited attributes in the pom model instance. I would analyze some attributes of a pom - but I need for it all attributes - incl. inhertied. What have I to do? I have tried Sonatype Aether but I did not find a example. 回答1: Check out this Gist https://gist.github.com/reiz/6203767. It shows a method which builds a MavenProject inside of a maven plugin. On the MavenProject you can call methods like project

what dependencies my project should have if I'm using JPA in Hibernate?

我的未来我决定 提交于 2019-12-05 02:36:31
问题 I use JPA, and Hibernate as its implementation. What maven2 dependencies I need to have in my project? 回答1: I believe the only two things you need are hibernate's entitymanager and then one of the SLF4J logging bundles. Everything else should be pulled in as dependencies: <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.5.1-Final</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <!--

Maven site deploy using ftp

杀马特。学长 韩版系。学妹 提交于 2019-12-05 02:27:41
I am using Maven2 and would like to deploy my generated site to a web server using ftp. i tried to use: <distributionManagement> <site> <id>website</id> <url>ftp://host/pub/</url> </site> </distributionManagement> the problem is that get an error that ftp is not supported. could it be that this basic feature doesn't work. Thanks, Ronen. As I misinterpreted your intention the first time. Here the right solution: Deploy site via ftp-server <project> [...] <distributionManagement> <repository> <id>ftpserver</id> <name>some ftpserver name</name> <url>ftp://host/pub</url> </repository> <

How can I fail Maven build if exec:java goal fails?

99封情书 提交于 2019-12-05 02:27:09
We're using the Maven exec:java goal to run a custom java application that configures a database for use with our integration tests. We want to use exec:java over exec:exec to be able to use the project dependencies in the classpath of the main class to be used. A few times the application has failed for valid reasons, but the Maven build continued as if nothing had gone wrong. Is there any "failonerror" type argument that can be used with exec:java ? I'm afraid to add system.exit() codes to the class being run, as I suspect it will kill not only itself, but also Maven itself, due to the fact

Get dependencies of WAR Artifact using Maven 2 API

不羁岁月 提交于 2019-12-05 02:21:45
问题 I have found a few posts surrounding the question of artifact retrieval however the answers don't seem to work in my specific case. I am writing a plugin that will help with skinny war EAR generation and I am running a plugin that I have written for my EAR maven module. In the plugin code I have got to the stage where I want to be able to get the dependencies / artifacts of the WAR dependencies - currently these are not coming through with anything I have tried. I presume this is because even

How to debug android application built with maven

心已入冬 提交于 2019-12-05 01:24:52
I'm currently trying to debug android application on my device from eclipse. Device has been added I can see it both in console and in eclipse. Console (Windows) : adb devices List of devices attached 0019cca27f2e6e device And the eclipse : I can run the app without any issues on both device/simulator. I just do clean install and android:deploy followed by android:run and works like a charm. But I can't figure out yet how to debug it. But when I actually run the app on the device(Samsung galaxy SII) I can only see these two processes executing com.viber.voip and com.viber.voip

Maven: PL/SQL script with sql-maven-plugin throws error PLS-00103

泪湿孤枕 提交于 2019-12-05 01:24:14
I'm trying to use the sql-maven-plugin to execute a PL/SQL script on an Oracle 11 database. Although the script is valid PL/SQL (as far as I can tell), the execution gives me a PLS-00103 error: The SQL script: (drop_all_tables.sql) BEGIN EXECUTE IMMEDIATE 'DROP TABLE MY_TABLE'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE; END IF; END; And my plugin configuration: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>sql-maven-plugin</artifactId> <version>1.5</version> <dependencies> <dependency> <groupId>oracle</groupId> <artifactId>jdbc</artifactId> <version>11.2.0.2.0<

How to specify the JAXB version in maven-jaxb2-plugin?

淺唱寂寞╮ 提交于 2019-12-05 01:16:06
问题 I need to use the latest version jaxb: 2.2.4-1, but maven or maven-jaxb2-plugin seems to pick up the one from the JDK. I tried specifying the version like this: <configuration> <specVersion>2.2</specVersion> ... </configuration> but the logs read: [INFO] [jaxb2:generate {execution: common}] [INFO] Started execution. [INFO] JAXB API is loaded from the [jar:file:/opt/jdk1.6.0_24/jre/lib/rt.jar!]. [INFO] Detected JAXB API version [2.1]. I tried to add dependencies to the correct versions of