0

This is continuous question for maven-site plugins 3.3 java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent

for latest maven (3.5.4), if we do not specific maven-site-plugin in project's pom file, then default version like:

[INFO] --- maven-site-plugin:3.3:site (default-site)

Is it possible to configure maven to always use the latest maven-site-plugin like 3.7.1 for all project?

This is different from How do I tell Maven to use the latest version of a dependency?, as I ask for maven plugin, some of them by default do not need to specify in pom, but general dependency you always need to specify in pom.

Changhua
  • 986
  • 5
  • 6
  • Please see the following question: https://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of-a-dependency – lexicore Jun 29 '18 at 10:39
  • In short, in "the Maven way" you should specify exact versions of plugins you use to build your project and update them manually/with some tools like the versions plugin. Otherwise you would risk breaking reproducible builds. This is why meta-versions like `LATEST` or `RELEASE` were dropped in Maven 3. – lexicore Jun 29 '18 at 10:41
  • I do not agree, I ask for maven plugin, not for any other dependency. – Changhua Jun 29 '18 at 10:46
  • That's the same principle. Maven will even warn you during the build if some of the plugins are missing the configured version. – lexicore Jun 29 '18 at 10:51
  • The problem is, for any other dependency, you need to specify them in POM, but for maven plugin, we do not need, maven will use the default version even will give the warn message. My question is, do you know how to change the default version for some plugin? – Changhua Jun 29 '18 at 10:57
  • 1
    @Changhua Relying on the defaults of Maven for plugin versions is simply bad practice. You should always define all versions of all used plugins in your build to get a reproducible build. Furthermore it's better to control the exact behaviour of the plugins in a way you have defined. Apart from that your stuck to the maven version are using and if your change the version version your build environment will change which is not what you want to have.... – khmarbaise Jun 29 '18 at 11:01
  • *but for maven plugin, we do not need* - my point being, we do. – lexicore Jun 29 '18 at 11:08
  • @lexicore which means in consequence your build is not reproducible and depends on the machine your are running etc. sorry. This is the same argument saying in Java you can write unit tests but you don't need to ... – khmarbaise Jun 29 '18 at 11:11
  • *My question is, do you know how to change the default version for some plugin?* - See https://stackoverflow.com/questions/10483180/maven-what-is-pluginmanagement – lexicore Jun 29 '18 at 11:12
  • *My question is, do you know how to change the default version for some plugin?* - You will also find `mvn versions:display-plugin-updates` handy (mentioned in the linked duplicate). – lexicore Jun 29 '18 at 11:13
  • @khmarbaise Absolutely agree. – lexicore Jun 29 '18 at 11:14
  • You simply define the version of the appropriate plugin in `..`... – khmarbaise Jun 29 '18 at 11:16
  • @khmarbaise and lexicore Thank you! – Changhua Jun 29 '18 at 16:25

0 Answers0