maven-plugin

How do I create a new packaging type for Maven?

I have a requirement to create jar files with Maven, but they need to be installed to the repository with a "foobar" extension , and it would be nice if they could have their own packaging type so we can identify those artifacts by the packaging. Can I set up a new packaging type to do this? ...

How do I execute a set of goals before my Maven plugin runs?

I'm writing a Maven plugin (Mojo) that needs to execute a standard set of other plugin executions before it is run. Is there a mechanism to declare all the goals within my plugin so I don't have to rely on the user defining them all in their POM? ...

How does Maven determine the order goals run in within a given phase?

As per this link... http://en.wikipedia.org/wiki/Apache_Maven#Build_Lifecycles I understand that Maven as a number of phases that run in the order they are defined for a given lifecycle. I also understand that you can attach goals to a phase. The problem is what happens when you attach a number of goals to a phase, how does Maven de...

Configure Maven plugins to stick together.

I have parent pom which configures certain plugins <pluginManagement> </plugins> <plugin> <artifactId>gmaven-plugin</artifactId> ... </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> ... </plugin> <plugin> <artifactId>cargo-maven2-plugin</arti...

How can I download Maven artifacts within a plugin?

I have a Maven plugin that takes a groupId, artifactId, and version in its confiugration. I want to be able to download that artifact from the remote repositories and copy the file into the project. I can't figure out how to download the artifact though. I understand that I can resolve dependencies using the dependency plugin, but I ne...

How can I resolve an artifact from the Maven repository within a plugin?

In a previous question I got an answer for downloading an artifact from the Maven repository. This works well for me, but I need to read the MavenProject for the downloaded artifact. What is the best way for me to read the MavenProject for the downloaded artifact in my plugin? ...

Package not found in maven jetty plugin

When i try to run jetty maven plugin(mvn jetty:run) I have received this error: [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure D:\projects\Projekt\src\main\java\Runner.java:[18,22] package org.apache.uima does not exist This package use class Runner, an...

Using output of maven assembler plugin as input to plugin

I have a number of maven projects which build various components of a plugin framework for a 3rd party application. I have a master project which, using aggregation ( element), includes all the sub projects. This master project also calls the maven assembler plugin. I can now build all the sub-projects and have the assembler copy their o...

How do you translate from checkstyle.xml to eclipse code style format/profile and back again?

I have eclipse code formatter and profile xml docs and I'd like to build a checkstyle.xml which I can use in my maven builds to run reports and generate the eclipse files. maven-eclipse-plugin appears to be able to generate the eclipse files from the checkstyle.xml (I think), but I'm not sure how to go the other way and I'm not looking...

Excluding "provided" dependencies from Maven assembly

I am trying to use the Maven assembly plugin to build a jar-with-dependencies, except those that have provided scope. I have copied the jar-with-dependencies into an assembly.xml file and configured its use in my pom. Here it is for reference: <?xml version="1.0" encoding="UTF-8"?> <assembly> <id>injectable-jar</id> <formats> <...

How to declare a before and after execution of a maven plugin around another plugin execution

Hi, I would like to create an execution order in my plugin which surrounds a maven plugin with a before and after execution of another maven plugin. All 3 executions are part of the deploy phase. Here is an example of what I want to do: phase:deploy url:get: execution-before dependency:unpack url:get: execution-after Note: url:get...

How to generate JUnit sources using maven-gunit-plugin

I have maven configured to run gunit (an ANTLR grammar unit testing tool) through the maven-gunit-plugin. gunit, however, has two different modes. The first mode causes gunit to act as an interpreter, reading through the *.gunit (or *.testsuite) file, interpreting it, and displaying the results. It can be configured as such: <plugi...

How to get access to Maven's dependency hierarchy within a plugin.

In my plugin I need to process the dependency hierarchy and get information (groupId, artifactId, version etc) about each dependency and if it was excluded. What is the best way to do this? ...

Convert Maven Site Software Documentation to PDF

I am currently working on a project written in Java and I am using Maven and the maven-site-plugin to generate a website containing all the relevant JavaDoc, reports, etc. I am needing at the same time to be able to convert the same documentation into a readable, book-like format. Are there any scripts or tools out there designed to ta...

Eclipse content assist with maven project not picking up all classes

I'm using Eclipse 3.5.0, and have imported a maven project using the import maven project from SCM wizard (M2 plugin). I have a jar file as a dependency in my pom. and inside the jar is a complicated schema - with quite a number of XSD's. But the content assist doesn't seem to pick up the schema at all, nor a number of other classes i...

Help with Selenium Maven Cargo

I am trying to use cargo to deploy and start my container (which works fine), and then use selenium to execute some UI tests. Whenever I try to run (mvn clean integration-test), I get to the point where it says Launching Selenium Server Waiting for Selenium Server... [INFO]Redirecting output to [INFO]User extensions But then my integ...

How do I tell JBehave META-INF to configure it for JPA using the Maven plugin?

I'm trying to get JBehave, JPA and Maven to play nicely together. I can run the test via eclipse and everything works just fine. I run it via maven, and JPA can't find the persistence.xml file. However a unit test I have finds the persistence.xml file just fine, but JBehave is not involved. Clearly I need to tell JBehave to look in src...

XML DTD/Schema validation maven plugin

Does anyone knows maven plugin that validate xml documents against DTD or Schema and generates reports? ...

Maven dependency versioning and java.lang.NoClassDefFoundError

Hi all, I have a Java project X has dependency (in pom file) on project Y. I was modifying in Y and build X,Y with Maven tool then runing X (on JBoss) without problems. When I added new class in Y then building with Maven (without problems), then running X, it throws java.lang.NoClassDefFoundError for the new class. I think its a Mav...

Using Maven for C/C++ projects

I'm putting Maven build around cluster of amateur, poorly written and frankly - primitive C/C++ code (meaning some C, some C++). Problem is - there's lots of it in circulation currently and cannot be easily replaced. Building it requires a lot of tribal knowledge (you have to go from cube to cube just to find out how to compile/build var...