maven-plugin

How to attach a maven plugin to a phase by default?

白昼怎懂夜的黑 提交于 2019-12-03 04:39:44
I have a maven plugin that should run in the compile phase, so in the project that consumes my plugin, I have to do something like this: <executions> <execution> <phase>compile</phase> <goals> <goal>my-goal</goal> </goals> </execution> </executions> What I need is to by default attach my-goal to the compile phase if the user has included my plugin already (ideally the above part wouldn't be necessary, just the plugin declaration). Is this possible? Put an @phase annotation in your Mojo classdef annotations. The doc says: @phase <phaseName> This annotation specifies the default phase for this

Maven Cobertura plugin not generating coverage.xml

老子叫甜甜 提交于 2019-12-03 04:07:00
问题 I am trying to generate a coverage.xml so that I can reference it in Cobertura plugin of Hudson, but the file is not being created. I've added the following to my POM <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.5.1</version> <configuration> <formats> <format>html</format> <format>xml</format> </formats> </configuration> </plugin> </plugins> </reporting> After running mvn cobertura:cobertura, the HTML site is

Create a GWT Maven Project

 ̄綄美尐妖づ 提交于 2019-12-03 03:47:50
I'm trying to create a new project with Eclipse in order to create GWT application under maven 2 system. I have create the project with the follow mvn command mvn archetype:generate -DarchetypeRepository=repo1.maven.org -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0 I have installed the follow eclipse plugins: * m2eclipse * egit * gwt plugin Here my POM file: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache

Bad request when updating Appengine with mvn appengine:update

天涯浪子 提交于 2019-12-03 03:23:46
i'm getting the following error, when I try to update a appengine-application with the appengine-maven-plugin: 400 Bad Request Error when loading application configuration: Unable to assign value '1.8.3' to attribute 'version': Value '1.8.3' for version does not match expression '^(?:^(?!-)[a-z\d\-]{0,62}[a-z\d]$)$' This is confusing to my because my appengine-web.xml looks like follows: <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>helloworld</application> <version>0-0-1</version> <threadsafe>true</threadsafe> <precompilation-enabled>false</precompilation-enabled

Plugins in Maven and POM.xml

*爱你&永不变心* 提交于 2019-12-03 02:57:22
问题 I just started using Maven and I read that plugins are additional components that can be used. A typical structure of pom.xml file is <project> <groupId>org.koshik.javabrains</groupId> <artifactId>JarName</artifactId> (A fldernamed JarName was created) <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>JarName</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency>

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

落花浮王杯 提交于 2019-12-03 02:39:47
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 default phase assigned to it in its source code (via @phase or via @execute phase ). In case of jetty

How to support multiple Scala versions in a library

吃可爱长大的小学妹 提交于 2019-12-03 02:37:12
问题 I have a fairly normal Scala project currently being built using Maven. I would like to support both Scala 2.9.x and the forthcoming 2.10, which is not binary or source compatible. I am willing to entertain converting to SBT if necessary, but I have run into some challenges. My requirements for this project are: Single source tree (no branching). I believe that trying to support multiple concurrent "master" branches for each Scala version will be the quickest way to miss bugfixes between the

What approach of improving incremental building of the maven projects do you prefer?

北慕城南 提交于 2019-12-03 02:30:44
I am going to optimize time of building our projects. One of the most time-consuming thing is a compilation of the projects. Due to known problem of the maven mentioned in particular here: Maven incremental building we have to use mvn clean before every building process. I have investigated this question and found out two approaches: Incremental-build-plugin Maven Mojo Maven 2 Reactor Plugin I have tested Incremental-build-plugin Maven Mojo and it looks pretty good. As I see Maven 2 Reactor Plugin implements almost the same functionality but the special command should be specified to achieve

Error in pom file in Maven project after importing into Eclipse

☆樱花仙子☆ 提交于 2019-12-03 02:15:49
I am actually new to the Maven framework. I already have a Maven project. I installed the Maven plugin etc into my EclipseIDE from http://m2eclipse.sonatype.org/sites/m2e . Then I imported my project and enabled dependencies, but the project is showing too many errors. The pom.xml itself is showing errors. The errors are Project Build Error:unknown packaging:apk Project Build Error:unresolvable build extension:plugin" etc. My error area is: project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0

tomcat7-maven-plugin tomcatManager status code:403, ReasonPhrase:Forbbiden

牧云@^-^@ 提交于 2019-12-03 01:43:29
问题 I am trying to do mvn clean package tomcat7:deploy but always I get this error: tomcatManager status code:403, ReasonPhrase:Forbbiden My configurations are the next: ~/.m2/settings.xml <servers> <server> <id>localhost</id> <username>tomcat</username> <password>s3cret</password> </server> </servers> pom.xml <profiles> <profile> <id>tomcat-localhost</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <tomcat-server>localhost</tomcat-server> <tomcat-url>http:/