maven-2

Maven - how/where to publish artifacts

我的未来我决定 提交于 2019-12-23 09:02:15
问题 I have open-sourced some of my projects. I'd like to publish the artifacts in a common place. If I don't have to host my own repository, that would be ideal, otherwise I will have to setup my own instance of Nexus (or other repository that you recommend). Can I publish artifacts to Maven Central? What process do I need to follow to get them there? 回答1: Yes you can, especially if it is an open source project. Here is some info: http://central.sonatype.org/pages/ossrh-guide.html 来源: https:/

Running maven goal in multiple lifecycles

百般思念 提交于 2019-12-23 07:25:54
问题 I have a case where I want to run the cobertura plugin in both the verify phase and the reporting phase. I have two profiles and they should both be running the cobertura plugin, but in profile A, I only want to create the xml/html output, but in profile B, I will be generating full site documentation that includes these results. I have cobertura configured as a plugin that runs as part of the verify phase, but if I do that, even if I run mvn verify site, the cobertura report does not appear

How do I link a plugin execution to a phase in maven without forcing me to specify plugin on command line

风流意气都作罢 提交于 2019-12-23 03:25:27
问题 I have a simple pom and added an ant-run to the compile but it only executes then when I do the following: mvn install antrun:run mvn install -- doesn't process the ant-run mvn antrun:run -- doesn't process the ant-run I thought that be linking the plugin to the lifecyce phase that the plugin would be executed when I try to achieve that phase. This is not what is happening. Am I missing some nuance, do I need to have a profile which enables the plugin? Thanks for the help (pom below) <project

How to calculate code coverage in Hudson using emma for a multi-module maven project but only run tests once

倖福魔咒の 提交于 2019-12-23 03:19:42
问题 We have several multi-module projects which I want to run emma against, but I don't want the tests to be run twice, because this results in misleading statistics on the Hudson project home page as unit tests are counted twice. For a single module project, we can ommit the install goal and just use clean emma:emma to run the tests once, is there any way we can test only using emma instrumented byte code and then build & install the project artifacts without running the tests a second time?

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

瘦欲@ 提交于 2019-12-23 02:57:25
问题 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

Error in running cucumber-jvm selenium test cases in headless mode under jenkins build

試著忘記壹切 提交于 2019-12-23 02:34:36
问题 Background I have a project desgined in spring-boot and maven. It contains cucumber-jvm selenium test cases which I want to run in headless mode in jenkins build. To do so, I have installed XVfb on jenkins build machine and also have made sure that Xvfb is running. $ps -ef | grep Xvfb root 3804 1 0 Sep29 ? 00:52:41 Xvfb -ac :99 -screen 0 1280x1024x16 Next, I am also exporting DISPLAY variable at the start of the build as follows, export DISPLAY=:99 Error The test fails to execute giving

How can I force maven to leave the version number out of dependency file names?

混江龙づ霸主 提交于 2019-12-22 19:20:10
问题 I'm using maven to build a ".ear" project that resolves dependencies from a maven repository, and then packages them into an ear (that's probably a redundant sentence...). When the dependencies show up in the ear file, they're named according to this format: <artifactId>-<version>.<type> I'd like them to be named: <artifactId>.<type> Can someone point me in the right direction? 回答1: If you're using the maven-assembly-plugin to build your ear, you can use the outputFileNameMapping property in

Sonar Eclipse Plugin - “Test connection”

纵然是瞬间 提交于 2019-12-22 18:52:25
问题 I use Sonar 2.4.1, Maven 2, Eclipse SDK 3.5. Sonar is up and running at http://127.0.0.1:9000. I've installed Sonar Eclipse Plugin and when i try to add a sonar server and i click "Test connetion" button ( http://localhost:9000 with or without user and password) i don't get "Connected successfully". Waiting for your answers. 回答1: For the Sonar Eclipse Plugin, make sure there is no side effect with the Eclipse proxy setting. As illustrated in this bug report: Connection via proxy works fine -

Sonar Eclipse Plugin - “Test connection”

时光毁灭记忆、已成空白 提交于 2019-12-22 18:52:09
问题 I use Sonar 2.4.1, Maven 2, Eclipse SDK 3.5. Sonar is up and running at http://127.0.0.1:9000. I've installed Sonar Eclipse Plugin and when i try to add a sonar server and i click "Test connetion" button ( http://localhost:9000 with or without user and password) i don't get "Connected successfully". Waiting for your answers. 回答1: For the Sonar Eclipse Plugin, make sure there is no side effect with the Eclipse proxy setting. As illustrated in this bug report: Connection via proxy works fine -

Is Developing Maven war apps in MyEclipse worth it?

微笑、不失礼 提交于 2019-12-22 18:45:24
问题 My organization has made an upper level decision to move to maven as the standard build tool for Java projects. I have been tasked with helping our local teams migrate projects over to maven. One of the core tools that is in play is the MyEclipse IDE. MyEclipse seems to have had a "fun" history with the maven team as evidenced in various places, especially when dealing with war projects. I haven't encountered problems with simple jar projects...yet. After fighting with MyEclipse and failing