pom.xml - How can I use bound version of core Maven plugin, but override its configuration? -
i want override configuration of core maven plugin in pom.
example:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <configuration> <!-- configuration here --> </configuration> </plugin>
maven gives warning version plugin missing. use version default binding, don't seem find way it.
- are there better ways override core plugin's configuration without (potentially) changing version?
- should ignore warning?
thanks
clarification: i'm familiar best practices. however, in opinion core plugins different in have explicitly declared versions. maven free add new core plugins, in case default version used despite attempts pin versions. moreover, maven doesn't warn when default version of core plugin being used — long don't try override configuration is.
it's best practice set plugin versions in pluginmanagement section of parent pom.
reason: plugins change behaviour in versions. pinning plugin versions key stable builds maven.
please note i've written parent pom, provides lot of common configuration. code open source, can use parent of parent pom (or in case have single module project), if like:
https://github.com/softsmithy/softsmithy-parent/blob/develop/pom.xml
just make sure override project-specific sections such organization, scm, issuemanagement, developers, licenses etc.
Comments
Post a Comment