maven-plugin

Can a maven mojo relying on Aether be compatible with Maven 3.0.x and 3.1.x?

我的未来我决定 提交于 2019-12-03 13:05:09
The 3.1.0 release of Maven relies on Eclipse Aether (org.eclipse.aether) instead of Sonatype Aether (org.sonatype.aether). This seems to break compatibility for plugins relying on Sonatype aether : try running such plugins and you'll run into : java.lang.NoClassDefFoundError: org/sonatype/aether/* Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.* As documented in https://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound Now, is it possible to make a mojo relying on aether classes (such as org.sonatype.aether.RepositorySystemSession) run both with Maven 3.0.x and

Is the maven-native-plugin widely used to build C++ projects using maven?

荒凉一梦 提交于 2019-12-03 13:04:15
It's been a little while since I did C++ development professionally and I'd like to get caught up on what the current state of C++ development is in a number of areas. Most of my recent work has been Java, making heavy use of Maven. When I last did C++ development for work, some variant of make was widely accepted as the way to go for building C++ projects (we were also using make to do builds the Java code in our mixed Java and C++ projects, although I believe ant was starting to become mainstream). I like using Maven for builds. My question is not to debate the relative merits of using Maven

How do you force a maven MOJO to be executed only once at the end of a build?

一笑奈何 提交于 2019-12-03 12:59:54
I have a MOJO I would like executed once, and once only after the test phase of the last project in the reactor to run. Using: if (!getProject().isExecutionRoot()) { return ; } at the start of the execute() method means my mojo gets executed once, however at the very beginning of the build - before all other child modules. The best solution I have found for this is: /** * The projects in the reactor. * * @parameter expression="${reactorProjects}" * @readonly */ private List reactorProjects; public void execute() throws MojoExecutionException { // only execute this mojo once, on the very last

Change maven dependency for artifact using classifier

岁酱吖の 提交于 2019-12-03 12:48:36
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 scope as provided and use the right foo package when using bar.jar ->Second (long) solution : Add

How to bind plugin mojos (goals) to few phases of default lifecycle?

China☆狼群 提交于 2019-12-03 12:09:45
My custom maven plugin have three goals (mojos): convert assigned to default phase: process-test-resources generateStubs assigned to default phase: package generateTests assigned to default phase: generate-test-sources How to bind this three mojo to default lifcycle phase , so the user can simply use plugin without special configuration and any changes to project packaging ? User should simply add: <plugin> <groupId>io.codearte.accurest</groupId> <artifactId>accurest-maven-plugin</artifactId> <extensions>true</extensions> </plugin> instead of <plugin> <groupId>io.codearte.accurest</groupId>

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

放肆的年华 提交于 2019-12-03 12:03:11
问题 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

Maven Dependencies can't be resolved

白昼怎懂夜的黑 提交于 2019-12-03 12:01:07
I'm using Apache Maven3 and since two or three days some dependencies can't be resolved any more, which first have not had a problem. To be more specific its: maven-findbgs-plugin:plugin:1.3.1 maven-cobertura-plugin:plugin:1.3 Shouldn't they be included by maven itself? My pom.xml file: <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.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>xyz</artifactId> <name>xyz</name> <description>xyz<

Error in pom file in Maven project after importing into Eclipse

馋奶兔 提交于 2019-12-03 11:53:32
问题 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"

What is the difference between artifactId and groupId in pom.xml?

一个人想着一个人 提交于 2019-12-03 10:14:09
How would you explain it to a newbie web developer or programmer with some real world organization example (like say facebook company or Google company)? From maven.apache.org, Naming Conventions : artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar you have to take the name of the jar as it's distributed. eg. maven , commons-math groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package

Organize imports with Maven2, Eclipse-style?

 ̄綄美尐妖づ 提交于 2019-12-03 09:02:59
I'm a lone Emacs user in a group that's hung up on Eclipse. Time and again, code diffs are made larger by imports that have been "organized" or "cleaned up" by Eclipse. I don't have a strong opinion on the subject of import style in Java, but I do want to minimize our diffs. What can I do? We use Maven2 for builds; is there a plugin that can help me? Can a piece of Eclipse be abstracted out & turned into a Maven plugin? I currently use ImportScrubber and have encountered a few other stand-alone pieces that do the same thing. What I'm really looking for is a Maven plugin that can integrate with