maven-plugin

Test Maven plugin with maven-plugin-testing-harness

大憨熊 提交于 2019-12-22 08:42:55
问题 I want to develop a Maven plugin and also test it properly. I was reading the documentation on maven-plugin-testing-harness and trying things out for a few hours already. I'm constantly running into NoClassDefFoundError and NoSuchMethodError , I just can't figure out which dependencies I need. Here's my MCVE: https://github.com/highsource/hello-maven-plugin Right now I'm getting: java.lang.NoClassDefFoundError: org/apache/maven/plugin/descriptor/PluginDescriptorBuilder at org.apache.maven

JBehave & Maven - how to skip scenario tests

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 08:34:27
问题 I'm using jbehave and the jbehave maven plugin to run a set of scenario tests. Have my test class extending JUnitStories, and everything works nicely. Only issue is, I can't stop running the tests... Every time I run the maven install goal, it runs the tests. I've tried adding a skip scenarios profile, below, but it doesn't stop the tests from running. <profile> <id>skipScenarios</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin<

getting information about maven dependencies

僤鯓⒐⒋嵵緔 提交于 2019-12-22 05:58:10
问题 I wonder if it is possible to get information about all first level dependencies of my maven project. I need the following information: name, vendor, version, license type, reference URL, description. All this information is stored in pom.xml of each package. The problem is that we have hierarchy of about 20 projects that have several hundreds dependencies that are constantly being changed. I know about maven dependency plugin. I ran mvn dependency:list and extracted list of packages using

Running exec-maven-plugin multiple times in a single phase

天涯浪子 提交于 2019-12-22 04:43:11
问题 I'm trying to test a client/server application, and using Maven to handle the build/test/deploy. To test the application, I need to: run an installer script (to install the server), kick off a startup command (to start the service), run the test (maven-surefire-plugin), stop the service, and uninstall the service. Steps 1,2,4 and 5 will use the maven-exec-plugin. Step 3 will use the maven-surefire-plugin. The problem is that all 5 of these steps will occur in the 'test' phase. Maven allows

Running exec-maven-plugin multiple times in a single phase

被刻印的时光 ゝ 提交于 2019-12-22 04:43:00
问题 I'm trying to test a client/server application, and using Maven to handle the build/test/deploy. To test the application, I need to: run an installer script (to install the server), kick off a startup command (to start the service), run the test (maven-surefire-plugin), stop the service, and uninstall the service. Steps 1,2,4 and 5 will use the maven-exec-plugin. Step 3 will use the maven-surefire-plugin. The problem is that all 5 of these steps will occur in the 'test' phase. Maven allows

Maven: how to pass parameters between Mojos?

坚强是说给别人听的谎言 提交于 2019-12-22 04:08:02
问题 How do I program one Mojo to set another Mojo's configuration? For example: Mojo A requires configuration parameter A.foo to be defined. A user can either specify A.foo manually or run plugin B which will calculate the value for him/her. 回答1: Answering my own question: It's possible to access a plugin's configuration or project-wide properties at runtime using a MavenProject instance: /** * The maven project. * * @parameter expression="${project}" * @readonly */ private MavenProject project;

Maven without Internet connection

僤鯓⒐⒋嵵緔 提交于 2019-12-22 01:34:27
问题 I'm new to maven project. I'm changing an ant project to maven project. To install the 3rd party jar's in maven local repository, I used install command. Its trying to download the resource jar.pom. I don't have download access in my organization so the build failed for installtion. After request i got the resouce jar and clean jar in my desktop(also i can get other necessary jar). How to make maven to use these jar for the process and how to install the jar in local repository without

Maven without Internet connection

↘锁芯ラ 提交于 2019-12-22 01:29:03
问题 I'm new to maven project. I'm changing an ant project to maven project. To install the 3rd party jar's in maven local repository, I used install command. Its trying to download the resource jar.pom. I don't have download access in my organization so the build failed for installtion. After request i got the resouce jar and clean jar in my desktop(also i can get other necessary jar). How to make maven to use these jar for the process and how to install the jar in local repository without

How to determine what artifacts are built from a maven reactor plan (ie: including sub modules)?

心不动则不痛 提交于 2019-12-21 20:35:15
问题 (Note: this question was originally posed by Dan Allen on Google+ here: https://plus.google.com/114112334290393746697/posts/G6BLNgjyqeQ) If I ran 'mvn install', what artifacts would it install? Or, if I ran 'mvn deploy', what artifacts would it deploy? This would likely be a fairly straightforward plugin to write, but I don't want to re-invent this if it's already available somewhere programmatically. It seems like this should be readily available somewhere. 回答1: As Andrew Logvinov already

maven can't find archetype in my repository

你说的曾经没有我的故事 提交于 2019-12-21 18:14:31
问题 I'm trying to create my own maven archetype. For now, I'm going through this tutorial [here][1] without success. I'm able to build the archetype project okay, but when I try to generate a project from that archetype I get the error below. Maven can't seem to find the archetype I created . Can any one spot my problem? Is there some other recomended tutorial for createing a maven archetype? Thanks. Maven version 3.0.3 Build Error: AR3Y35-LAPTOP:EclipseWS Albert$ mvn archetype:generate -DgroupId