Questions tagged [maven-mojo]

A mojo is a Maven plain Old Java Object. Each mojo is an executable goal in Maven, and a plugin is a distribution of one or more related mojos.

25 questions
9
votes
3 answers

Maven plugin development - how to ensure building for Maven 3.0.x instead of 3.1.x?

I'm trying to develop a custom Maven plugin. I'm currently running into this problem when I execute my unit tests: java.lang.NoClassDefFoundError: org.eclipse.aether.RepositorySystemSession Stack trace is…
FrustratedWithFormsDesigner
  • 26,726
  • 31
  • 139
  • 202
4
votes
1 answer

Mojo add eclipse source folder

I have written a maven plugin that generates source code. This works basically fine. The problem is, that Eclipse does not recognize the directory where I generate the code as an additional source folder. Therefore I get tons of errors saying XXX…
Qw3ry
  • 1,319
  • 15
  • 31
3
votes
1 answer

How to resolve dependency between files generated by maven plugin at compile time?

Ok, let me try to put my problem across as less confusing as I can. I have a standard maven project with a few Maven plugins - 1) maven-antrun-plugin 2) Custom maven plugin, say, my-maven-plugin 3) jaxws-maven-plugin Now here's the complicated…
2
votes
0 answers

Wrong dependency resolution in multi module build since maven 3.3

I created a maven plugin that picks up all project dependencies and fills a template file with these artifact informtion: jnlp-maven-plugin. It includes test cases to observe the described behaviour. Since maven 3.3 the plugin picks up too many…
PaL
  • 136
  • 2
  • 10
2
votes
0 answers

How to access local maven repository in plexus component?

I am writing a custom DependencyAnalyzer which plugs into the dependency:analyze goal. The analyzer is a plexus component whose sole parameter is the MavenProject instance. My analyzer needs access to the local repository to be able to invoke the…
Jens Bannmann
  • 4,845
  • 5
  • 49
  • 76
2
votes
2 answers

How do you get the maven binary version from within a custom Mojo?

I'm referring to the maven binary version that is returned when you usually run mvn --version from the command line which returns an output like the below, Apache Maven 3.0.4 Maven home: /usr/share/maven Java version: 1.6.0_45, vendor: Sun…
UDJ
  • 281
  • 2
  • 10
1
vote
1 answer

JOOQ custom code generator with maven mojos

I have a custom code generator extending JavaGenerator and it would be very useful if the user using this generator could specify additional information like a list of column names to which the custom generator applies to. My first though would be…
wand555
  • 155
  • 6
1
vote
0 answers

Can't get system parameter from custom maven MOJO

I try to get the value of a system property in a custom maven MOJO, like described here : https://maven.apache.org/developers/mojo-api-specification.html. The property which I try to get the value is "releaseVersion" from the following command line…
1
vote
1 answer

AbstractMojo implementation

Actually I want to run a java class while running mvn clean install on my project. I found that the best solution is to work with abstractMojo and define the treatment inside the execute method. Can you please give me a simple example that describes…
GHCoder
  • 21
  • 7
1
vote
1 answer

Does Maven Mojo have Equivalent to ant's DirSet?

I'm uplifting an ant plugin to maven plugin and my ant plugin used a DirSet and I see that maven only has a FileSet. Can I use FileSet to just gather directories? Should I create my own dirset class either from reviewing Ant's PatternSet - DirSet…
Peter Kahn
  • 12,364
  • 20
  • 77
  • 135
1
vote
1 answer

Call groovy 'main' method from Maven

I want to call the 'main' method in a groovy class in the 'package' phase from maven. I tried the gmaven plugin org.codehaus.groovy.maven gmaven-plugin
user3230140
  • 43
  • 1
  • 5
1
vote
2 answers

Java Maven Mojo : Complex Map Attribute

The example of map attribute for a mojo mentioned in maven.apache.org is quite simple as it defines a Map with a String as a key and as a value as specified below : /** * My Map. */ @Parameter private Map myMap; and it's assigned configuration…
Mouadh
  • 11
  • 2
1
vote
0 answers

Injecting default Maven project into other Maven components

I am developing a Maven plugin and I make use of the Assembly API to do some custom assembly construction. When my code runs, I get this stack trace: java.lang.NullPointerException: null at…
FrustratedWithFormsDesigner
  • 26,726
  • 31
  • 139
  • 202
1
vote
2 answers

Maven Mojo Unknown lifecycle phase

Actually im working with maven plugins and creating own maven plugins. first i followed this tutorial: http://maven.apache.org/guides/plugin/guide-java-plugin-development.html but i realised that this isnt working anymore cause somehow…
user1882812
  • 936
  • 5
  • 18
  • 41
0
votes
0 answers

General way to set JVM args in pom.xml independent from plugin used

I have a Maven project which generates code with the help of the org.codehaus.mojo.xml-maven-plugin (version 1.0.2) by using XSLT transformation. However, when run it exceeds the XPath operator limit of 100: JAXP0801002: the compiler encountered an…
Christoph John
  • 3,003
  • 2
  • 13
  • 23
1
2