devonfw / maven-parent

Parent POM used for maven projects in devonfw
Apache License 2.0
0 stars 4 forks source link

Complete first version of this parent-pom #2

Closed hohwille closed 4 years ago

hohwille commented 4 years ago

Feedback from @vapadwal in #1: As discussed earlier I was comparing parent pom with our devon4j parent and below are my findings

       <groupId>org.owasp</groupId>
        <artifactId>dependency-check-maven</artifactId>
        <configuration>
          <failOnError>false</failOnError>
        </configuration>
hohwille commented 4 years ago

Should we go for Java 11 here instead of 1.8</java.version>

Godd question. I am happy for going forward and being innovative.

However, compiling with a newer java version will prevent usage in earlier versions. I know still quite a lot of projects which a still in the progress of upgrading from Java 1.8 and will take many more months (some maybe even a year) for this migration. We should IMHO not prevent them from using new releases of e.g. devon4j yet, especially as we are winning almost nothing important for our coding by moving to java 11.

hohwille commented 4 years ago

license-maven-plugin, can put this in parent.

Very good point. This is indeed missing and needs to be added to this new parent pom. Thanks for pointing this out. 👍

hohwille commented 4 years ago

maven-war-plugin is this required in parent pom ?

We provide versions of plugins to use in <pluginManagement> section. This is important as Maven for compatibility comes with a super-pom with very old versions by default. Those versions prevent usage with e.g. Java11. For projects not using maven-war-plugin this does not hurt in anyway. But many projects in devonfw are building (bootified) war files still.

hohwille commented 4 years ago

In this plugin (dependency-check-maven) we have kept failOnError false in devon4j, but this was for security profile

We also have this in security profile: https://github.com/devonfw/maven-parent/blob/5c7164b7f93056be9b2935d69aa5db244dcb6f76/pom.xml#L426

The snipplet you referenced comes from reporting where it should never fail and break the site build: https://github.com/devonfw/maven-parent/blob/5c7164b7f93056be9b2935d69aa5db244dcb6f76/pom.xml#L356

But you are right that it differs from devon4j config and should be aligned. devon4j reporting: https://github.com/devonfw/devon4j/blob/fe2ffffe81cf1512d7b0955852a206e1c153cfdd/pom.xml#L411

devon4j security profile: https://github.com/devonfw/maven-parent/blob/5c7164b7f93056be9b2935d69aa5db244dcb6f76/pom.xml#L426

So I think security profile fits but the reporting config needs to be aligned with devon4j pom.

hohwille commented 4 years ago

maven-surefire-plugin we were having <argLine>-Duser.language=en -Duser.region=EN</argLine>

This was actually a copy & paste initially from mmm project when I started oasp4j. The reason for this setting was to standardize the locale for NLS/I18N tests. As we are developing accross all countries in devonfw this setting does not make much sense as default here. Also it is better to write tests in a more locale independent way.

hohwille commented 4 years ago

In maven-javadoc-plugin, we were having javax.interceptor-api as additionalDependency , I think this was because of error javax.interceptor.InterceptorBinding but I am still not sure it is required, might be specific to Java 8

Also an interesting finding. We should test devon4j javadoc generation (both the project itself as well as on the outcome of the archetype (template-server). If that works, we can leave it as is. If we get errors related to javax.interceptor we need to introduce this dependency here again.

hohwille commented 4 years ago

Found some more aspects in devon4j:

<packagingExcludes>WEB-INF/classes/config/application.properties,*.jsp</packagingExcludes>

Also:

  <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-archetype-plugin</artifactId>
          <version>${maven.archetype.version}</version>
        </plugin>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring.boot.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
hohwille commented 4 years ago

As we might not want to maintain the spring-boot version in our parent pom the spring-boot-maven-plugin should stay in devon4j then.

hohwille commented 4 years ago

For taglist-maven-plugin the REVIEW tag was lost.

hohwille commented 4 years ago
MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
[ERROR] /Users/hohwille/projects/devon/workspaces/main/devon4j/modules/test/src/main/java/com/devonfw/module/test/common/base/BaseTest.java:36: warning - Tag @link: reference not found: org.junit.BeforeClass
[ERROR]
[ERROR] Command line was: /Users/hohwille/projects/devon/software/java/bin/javadoc @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/Users/hohwille/projects/devon/workspaces/main/devon4j/modules/test/target/apidocs' dir.
hohwille commented 4 years ago

Site generation fails:

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NullPointerException
    at java.util.HashSet.<init> (HashSet.java:119)
    at org.codehaus.mojo.license.api.ResolvedProjectDependencies.<init> (ResolvedProjectDependencies.java:50)
    at org.codehaus.mojo.license.AbstractThirdPartyReportMojo.createThirdPartyDetails (AbstractThirdPartyReportMojo.java:559)
    at org.codehaus.mojo.license.AggregatorThirdPartyReportMojo.createThirdPartyDetails (AggregatorThirdPartyReportMojo.java:127)
    at org.codehaus.mojo.license.AbstractThirdPartyReportMojo.executeReport (AbstractThirdPartyReportMojo.java:420)
    at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:251)
    at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:230)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:349)
    at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:198)
    at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:147)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
hohwille commented 4 years ago

NPE happens here:

https://github.com/mojohaus/license-maven-plugin/blob/d47178b5c58d74714bda202e358bf7927ec67788/src/main/java/org/codehaus/mojo/license/api/ResolvedProjectDependencies.java#L50

So the provided Set to make immutable is already null.

hohwille commented 4 years ago

https://github.com/mojohaus/license-maven-plugin/issues/358 So we just downgrade the plugin to 1.20 and upgrade again once a fix is released.

hohwille commented 4 years ago

Now I got:

[ERROR] Java heap space -> [Help 1]
java.lang.OutOfMemoryError: Java heap space
    at org.jruby.ext.zlib.JZlibInflate.run (JZlibInflate.java:267)

I thought with Java11 these heap tuning days are over but it seems I was wrong.

hohwille commented 4 years ago

See https://github.com/devonfw/ide/issues/311 So great test as we found an issue with devonfw-ide and can improve it. With all these fixes we should now be quite complete. Site generation test is still running though...

hohwille commented 4 years ago

I tried to build the first release but failed:

Invalid POM: /com/devonfw/maven-parent/1/maven-parent-1.pom: Developer information missing

Seems I have to add the developer block again. I got rid of this as it is inherited to all projects and so far there always have been only two developers written in POM which where "Krzysztof Sobkowiak" and me. Does not make much sense to me but I will add this block again then. According GPDR I also will not others. Feel free to add yourself anytime if you like. This is IMHO not about credits but more about satifaction of OSSRH policy.

hohwille commented 4 years ago
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:16 h

OK. So maven site is not fast (as before) but works.

hohwille commented 4 years ago

Done and released to maven central.