I want to execute maven command from Java for development of a plugin. I tried maven-embedder but looks like it is now not supported. Is someone aware of some other tool which can be used?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Maven embedder is indeed no longer supported (only hudson still uses it). But, as in hudson, there are several other ways to run maven. You could simply run maven as an external program:
Or you could consider creating an ant script for maven. This script could then be called either as an external program or (if you need more control) adding ant to your classpath and calling the Antrunner.
UPDATE
Maven embedder is now supported again so that is your best option.
Use Maven Embedder
Maven embedder is still supported and easy to configure, so this is better option for you.
Java code
Project configuration
Fully working example: https://github.com/mariuszs/maven-cli-example
A simple invocation API : maven-invoker.
Project documentation : http://maven.apache.org/shared/maven-invoker/
Usage : http://maven.apache.org/shared/maven-invoker/usage.html