Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the syntax for a Maven parameter of type String[]

For example the annotationProcessors parameter in the Maven Compiler Plugin needs a String[] as a parameter.

What is the syntax for a String Array in Maven?

like image 942
AndiDev Avatar asked Jan 02 '13 10:01

AndiDev


People also ask

What is the correct syntax for executing a Maven plugin?

Usage of a Maven Plugin xml you can use the shorthand notation to execute the plugin: mvn <prefix>:<goal> , commonly the “prefix” is the artifact ID minus the “-maven-plugin”. For example mvn example:version .

What are the correct type of Maven plugins?

Introduction. In Maven, there are two kinds of plugins, build and reporting: Build plugins are executed during the build and configured in the <build/> element. Reporting plugins are executed during the site generation and configured in the <reporting/> element.

What is plugin management Maven?

From Maven documentation: pluginManagement: is an element that is seen along side plugins. Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one.

Which Maven plugin do we use when we create a Maven project?

For example, to compile your project maven uses maven-compiler-plugin , to run tests - maven-surefire-plugin and so on. Dependency in terms of maven is a packaged piece of classes that your project depends on. It can be jar, war etc.


1 Answers

Off the top of my head arrays are handled this way:

<annotationProcessors>
    <annotationProcessor>com.example.AP1</annotationProcessor>
    <annotationProcessor>com.example.AP2</annotationProcessor>
</annotationProcessors>

(an old post on the apache maven-users mailing list supports this).

like image 132
Heiner Westphal Avatar answered Oct 02 '22 15:10

Heiner Westphal