maven-2

Auto deploy on save Netbeans entreprise project using maven

久未见 提交于 2019-12-07 02:02:28
问题 I have a NetBeans mavenized project Contaning: web project ( war ) ejb project ( jar ) parent project maven project After every change I must clean an build the maven project and Run the Parent project How canI configure my projects to auto deploy on save ? the configuration file( nb-configuration.xml ) is as follows : <?xml version="1.0" encoding="UTF-8"?> <project-shared-configuration> <!-- This file contains additional configuration written by modules in the NetBeans IDE. The configuration

How to prevent Maven from accessing remote repositories?

此生再无相见时 提交于 2019-12-07 01:55:27
问题 How can I enforce Maven to only use my local repository and single specific repository on intranet and not downloading anything from internet? Even my POMs all has single company's internal repository specified, maven goes to internet repositories taken from libs' POM files to fetch dependencies. 回答1: In your settings.xml (usually under %user.home%/.m2) you can configure this. E.g. <mirrors> <mirror> <id>repo.example.com</id> <mirrorOf>*</mirrorOf> <name>Internal repo</name> <url>http://repo

How do you perform a reactor build in Maven3 without a root project?

大憨熊 提交于 2019-12-07 01:52:42
问题 How does one perform an ad-hoc reactor build over multiple maven projects without a root project? This used to be possible in maven2 by invoking the mvn command with the '-r' option which would search recursively from the working directory for projects and organize them in the reactor to build in the correct order even if the projects did not share a common parent pom.xml. Optionally one could specifically include or exclude certain projects using maven.reactor.includes and maven.reactor

Maven/Eclipse: The default build path for resources excluded everything

Deadly 提交于 2019-12-07 01:24:21
问题 I'm using M2E for maven integration with eclipse. My unit tests reference property files in the resources/ directory. Well, everything fine in the command line test ( mvn test ). However, in Eclipse, the resources couldn't be found. Check the Java Build Path, there, all resources entries are marked with Excluded: ** . (I deem it should only exclude .java/ .class files) Then, after removed the exclude pattern, the problem fixed. I'm not sure whether I should remove all Excluded ** by hand, or

Maven Surefire: Unable to fork parallel test execution

怎甘沉沦 提交于 2019-12-07 01:05:58
问题 using Maven surefire, I'm unable to fork parallel test execution. That is, each of my test cases hs to run in a serapate JVM, hence the forking. In addition, I want my test cases to run in parallel. the first part is working without problem: I'm able to run each test case in its own JVM. the second part, however is still a challene for me. I haven't managed to get the paralle execution of test cases working. Here is how my plugin declaration look like: <plugin> <groupId>org.apache.maven

m2eclipse resource filtering

佐手、 提交于 2019-12-07 01:02:41
问题 I've having problems with resource filtering using m2eclipse Maven support in Eclipse. It seems that filtering only takes place on resources that have changed. This is fundamentally flawed because, if I have a file that references properties (e.g. ${my.property}, if the value of the property changes, the filtering will only be performed if the referencing file is also modified - if I only change the property value (in my pom.xml), the filtering is not applied to the files that that reference

Maven, configure specific goal

倖福魔咒の 提交于 2019-12-06 23:57:55
问题 I want to configure "exploded" goal of the maven-war-plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <executions> <execution> <goals> <goal>exploded</goal> </goals> <configuration> <webappDirectory>war</webappDirectory> </configuration> </execution> </executions> </plugin> I need to run "exploded" goal manually and do not want to attach execution to any lifycycle phase. But when i execute "mvn war:exploded", maven ignores my configuration

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

孤人 提交于 2019-12-06 21:38:00
问题 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

How to pass parameters to guicified TestNG test from Surefire Maven plugin?

只谈情不闲聊 提交于 2019-12-06 20:48:24
I'm using Maven + Surefire + TestNG + Guice (latest stable ones) I have "large" test that requires Guice to run. Basically I'm doing it this way: @Test(groups = "large") @Guice(modules = FooLargeTest.Module.class) public class FooLargeTest { public static class Module extends AbstractModule { public void configure() { bindConstant().annotatedWith(FooPort.class).to(5000); // ... some other test bindings } } @Inject Provider<Foo> fooProvider; @Test public void testFoo() { Foo foo = fooProvider.get() // here injection of port is done // it could not be passed to constructor // ... actual test of

How to use or abuse artifact classifiers in maven?

狂风中的少年 提交于 2019-12-06 19:10:51
问题 We are currently attempting to port a very (very) large project built with ant to maven (while also moving to svn). All possibilities are being explored in remodeling the project structure to best fit the maven paradigm. Now to be more specific, I have come across classifiers and would like to know how I could use them to my advantage, while refraining from "classifier anti-patterns". Thanks from: http://maven.apache.org/pom.html classifier: You may occasionally find a fifth element on the