maven-plugin

How to populate parameter “defaultValue” in Maven “AbstractMojoTestCase”?

一曲冷凌霜 提交于 2019-12-21 16:56:59
问题 I have a Maven plugin that I am attempting to test using a subclass of the AbstractMojoTestCase . The plugin Mojo defines an outputFolder parameter with a defaultValue . This parameter is not generally expected to be provided by the user in the POM. @Parameter(defaultValue = "${project.build.directory}/someOutputFolder") private File outputFolder; And if I use the plugin in a real scenario then the outputFolder gets defaulted as expected. But if I test the Mojo using the AbstractMojoTestCase

Maven discovery completed without finding any extensions

放肆的年华 提交于 2019-12-21 09:16:49
问题 I have installed eclipse 4.3 on my system and recently installed the Maven integration plugin. I get the following error: Discovery completed without finding any extensions. Please check your network connection and try again. The catalog url is http://download.eclipse.org/technology/m2e/discovery/directory-1.4.xml Note : No proxies, no network issues 回答1: There is a Java update 1.7.0_45 which fixes that problem. 回答2: I was having the same issue on Mac OS X 10.8.5 with eclipse-kepler and Java

mvn deploy:file to different repositories for snapshot and release version

社会主义新天地 提交于 2019-12-21 06:56:26
问题 Is it possible to in some way tell the maven deploy:file goal to deploy to two independent artifactories based on whether the version of the project is a snapshot / release? I'm hoping there might be a property which indicates the fact the version has -SNAPSHOT prepended, or perhaps the default artifactory to deploy to (which has been worked out based on the version number already). I thought about using two different profiles and working out if its a snapshot in ant by parsing the pom.xml

Change maven dependency for artifact using classifier

五迷三道 提交于 2019-12-21 04:15:53
问题 With the maven jar plugin I build two jar: bar-1.0.0.jar and bar-1.0.0-client.jar. Actually in my POM I have the following dependency: <dependency> <groupId>de.app.test</groupId> <artifactId>foo</artifactId> <version>1.0.0</version> </dependency> This artifact exist also in two version bar-1.0.0.jar and bar-1.0.0-client.jar I want to make bar-1.0.0-client.jar dependent of foo-1.0.0-client.jar and bar-1.0.0.jar dependent of foo-1.0.0.jar . ================ ->First (wrong) solution: define the

Maven findbugs:check - Output Summary Of Bugs

房东的猫 提交于 2019-12-20 23:30:26
问题 Does anybody know how to configure the maven findbugs plugin to output a summary of the bugs to the console (similar to the pmd plugin)? At present findbugs:check just prints out how many bugs there are in total and I need to check the individual modules target/findbugs directory and each findbugs.xml file to fix the issues. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>2.0.1</version> <configuration> <xmlOutput>true</xmlOutput>

How to set context path to root(“/”) in Tomcat 7.0 when using Maven

ぐ巨炮叔叔 提交于 2019-12-20 17:37:41
问题 I hava a maven project, pom.xml contains tomcat plugin. <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> </plugin> I've downloaded Tomcat 7, so I've got Tomcat directory (apache-tomcat-7.0.56). I tried three goals to run my project: tomcat7:run, tomcat7:run-war, tomcat7:run-war-only My application is running at http://localhost:8080/projectname , if I run tomcat7:run-war, projectname-0.0.1-SNAPSHOT.war appears in the

Why can Maven not find my custom Mojo?

谁都会走 提交于 2019-12-20 17:13:29
问题 I have an own Mojo class. @Mojo(name="mojo", threadSafe=true) public class MyMojo extends AbstractMojo { @Component private MavenProject project; public void execute() throws MojoExecutionException, MojoFailureException { getLog().info("Execute"); } } After that I install it in local repository. [INFO] Applying mojo extractor for language: java-annotations [INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors. [INFO] Applying mojo extractor for language: java [INFO]

Why can Maven not find my custom Mojo?

ε祈祈猫儿з 提交于 2019-12-20 17:13:13
问题 I have an own Mojo class. @Mojo(name="mojo", threadSafe=true) public class MyMojo extends AbstractMojo { @Component private MavenProject project; public void execute() throws MojoExecutionException, MojoFailureException { getLog().info("Execute"); } } After that I install it in local repository. [INFO] Applying mojo extractor for language: java-annotations [INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors. [INFO] Applying mojo extractor for language: java [INFO]

Maven AspectJ plugin fails to build with Java 9 due to missing tools.jar

旧巷老猫 提交于 2019-12-20 12:36:11
问题 I switched my JDK version from 8 to 9 and the AspectJ plugin no longer works due to missing tools.jar: Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.10:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.10 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:9.0.1 at specified path C:\Program Files\Java\jdk-9.0.1/../lib/tools.jar I understand that tools.jar (and rt.jar) were removed from Java 9 JDK. I am wondering if

How can I find out the default phase a Maven goal binds to?

谁说胖子不能爱 提交于 2019-12-20 12:29:20
问题 In Maven, how can I find out the default phase of a goal (if any default phase exists at all for this particular goal)? Example I am using a Maven plugin called Jetty Maven Plugin. It contains a goal jetty:run . Running the command mvn jetty:run (notice this command only contains a goal, not a phase) first builds a pom.xml -specified web application up to the default test-compile phase, then deploys it inside a Jetty server. As pointed out in the Mojo API Specification, a goal can have a