Questions tagged [maven-plugin]

Do not use this tag for the use of specific Maven plugins. Use it only for Maven plugins development related questions.

Maven Plugins, also known as Mojos, are the central feature of Maven that allow for the reuse of common build logic across multiple projects.

From the official Maven documentation

"Maven" is really just a core framework for a collection of Maven Plugins. In other words, plugins are where much of the real action is performed, plugins are used to: create jar files, create war files, compile code, unit test code, create project documentation, and on and on. Almost any action that you can think of performing on a project is implemented as a Maven plugin.


Please do not use this tag for the use of specific Maven plugins. Use it only for Maven plugins development related questions.

More information

3670 questions
1
vote
1 answer

Add dependency from custom plugin

I'm developing custom Maven plugin. I want my plugin to add a new dependency to a project. I have the following code: @Mojo(name = "generate-model", defaultPhase = LifecyclePhase.GENERATE_SOURCES) public class ModelGeneratorMojo extends AbstractMojo…
talex
  • 17,973
  • 3
  • 29
  • 66
1
vote
1 answer

Maven plugin dependency isn't added to classpath in multi-module scenario

i have an multi-module maven project with the following structure: Root sub-module1 sub-module2 sub-module3 Now i created an maven plugin that should generate sources. I've added the plugin to the pom of sub-module2. This plugin configuration…
Michael
  • 11
  • 3
1
vote
1 answer

Create a jar artifact with minimal pom / parent pom.xml / flattened / regenerated pom [maven]

I have a multimodule maven project and distribute the resulting jar file to different parties. Part of the jar file is the pom.xml file (in META-INF/maven/.../pom.xml). The problem with that is, that the parent pom.xml is missing which contains a…
Lonzak
  • 9,334
  • 5
  • 57
  • 88
1
vote
4 answers

How to build maven java based project in eclipse

I have to import a project with Maven2. So far i installed eclipse gallelio then installed the software eclipse IAM and apache maven. Then i create an new maven2 project with quickstart maven architecture. After that i import my java project into…
Amit Pal
  • 10,604
  • 26
  • 80
  • 160
1
vote
1 answer

zip some modules including target directory from multi-module maven project

I have a multi-module maven project with the below hierarchy and wanted to create a zip after the mvn build and curl or upload it to one private repository. I am using the maven-assembly-plugin but it is not including the required directory. Please…
sagar verma
  • 404
  • 4
  • 10
1
vote
1 answer

maven scoverage check for lines/branches not covered by unit tests

I am quite new to maven scoverage plugin which is the preferred code coverage tool in the team that I am working with. I am trying to generate reports for test coverage using the following command: mvn scoverage:report It gives me a detailed…
Vikas Saxena
  • 1,073
  • 1
  • 12
  • 21
1
vote
1 answer

Maven release plugin scmReleaseCommitComment parameter

I am using maven release plugin for automated releases from Jenkins without any Jenkins-plugins. Release commit, tag and development commit are created in Git and released project is deployed to Nexus. What I try to achieve is to change the release…
leventcinel
  • 358
  • 2
  • 5
1
vote
0 answers

How to include files at the same level as the project pom in archetype-metadata.xml

I created a Maven custom archetype with the following structure: archetype-structure When I create the project with the command mvn archetype:generate the app.xml and app.properties files are not included. How can I solve?
1
vote
0 answers

code coverage for component test not showing in multi-module project

I am using jacoco-maven-plugin to generate coverage report and using sonar-maven-plugin plugin to upload the report to SonarQube. I am having below multi-module structure. BitBucket…
Jigar Naik
  • 1,946
  • 5
  • 29
  • 60
1
vote
1 answer

Execute maven plugin in children, not grandchildren or parent

I have a maven Mojo plugin that I'd like to execute only in child pom, but not in the current pom or grandchildren poms. My plugin runs at compile time and essentially reads files, and for my use case if it runs in the child pom, it is redundant to…
VMS
  • 393
  • 6
  • 15
1
vote
1 answer

Maven GPG plugin 3.0.0 is missing

Here is maven-gpg-plugin version 3.0.0 official page: http://maven.apache.org/components/plugins-archives/maven-gpg-plugin-LATEST/download.cgi However: the download links not working Maven central shows that the latest version of plugin is 1.6 Is…
vve1der
  • 60
  • 5
1
vote
0 answers

Maven Unable to parse configuration of mojo for parameter #

Did a maven build using a custom maven plugin. Got the following error: Unable to parse configuration of mojo for parameter #: Cannot find default setter in class What does "#" mean? Normally if the plugin complains…
B.Z.
  • 418
  • 5
  • 12
1
vote
0 answers

Add a non-classpath dependency in Maven

I would like to add a dependency to my maven project so that Maven can resolve the dependency, but not add it to the classpath. E.g. com.example example-artifact bin
steve hannah
  • 4,586
  • 11
  • 18
1
vote
1 answer

Why might my Maven Mojo lose its configuration properties when run individually?

I've got an outstanding issue in jasmine-maven-plugin and I can't figure it out. You're welcome to try this out yourself, but the gist is that when one runs: mvn jasmine:test The properties configured in the pom.xml for the plugin are not set on…
Justin Searls
  • 4,789
  • 4
  • 45
  • 56
1
vote
1 answer

Running maven plugin from command line outside pom.xml

Below is the snyk plugin setup for maven. I have setup the plugin in pom.xml. I configured the maven set up in a pipeline. The below configuration has a secret API_TOKEN. Setting API_TOKEN as a variable in any file except the default pipeline file…
Subit Das
  • 15
  • 4