Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete first version of this parent-pom #2

Closed
hohwille opened this issue Nov 21, 2019 · 18 comments
Closed

Complete first version of this parent-pom #2

hohwille opened this issue Nov 21, 2019 · 18 comments
Labels
enhancement New feature or request

Comments

@hohwille
Copy link
Member

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

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

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

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

  • In this plugin we have kept failOnError false in devon4j, but this was for security profile

       <groupId>org.owasp</groupId>
        <artifactId>dependency-check-maven</artifactId>
        <configuration>
          <failOnError>false</failOnError>
        </configuration>

  • maven-surefire-plugin we were having
<argLine>-Duser.language=en -Duser.region=EN</argLine>
  • 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
<plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.1.0</version>
          <configuration>
            <additionalDependencies>
              <additionalDependency>
                <groupId>javax.interceptor</groupId>
                <artifactId>javax.interceptor-api</artifactId>
                <version>1.2</version>
              </additionalDependency>
            </additionalDependencies>
            <!-- https://issues.apache.org/jira/browse/MJAVADOC-308 -->
            <!-- <notree>true</notree> -->
            <show>private</show>
            <encoding>${project.reporting.outputEncoding}</encoding>
            <charset>${project.build.sourceEncoding}</charset>
            <docfilessubdirs>true</docfilessubdirs>
            <additionalOptions>
              <additionalOption>${javadoc.option.doclint}</additionalOption>
            </additionalOptions>
            <source>8</source>
            <links>
              <link>http://docs.oracle.com/javase/7/docs/api/</link>
              <link>http://m-m-m.sourceforge.net/apidocs/</link>
            </links>
            <doctitle>JavaDocs for ${project.name}</doctitle>
            <windowtitle>JavaDocs for ${project.name}</windowtitle>
          </configuration>
        </plugin>
@hohwille hohwille added the enhancement New feature or request label Nov 21, 2019
@hohwille
Copy link
Member Author

Should we go for Java 11 here instead of <java.version>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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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:

<id>security</id>

The snipplet you referenced comes from reporting where it should never fail and break the site build:

<artifactId>dependency-check-maven</artifactId>

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:

<id>security</id>

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

@hohwille
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

hohwille commented Nov 25, 2019

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
Copy link
Member Author

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
Copy link
Member Author

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

@hohwille
Copy link
Member Author

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 added a commit that referenced this issue Nov 25, 2019
hohwille added a commit that referenced this issue Nov 25, 2019
@hohwille
Copy link
Member Author

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
Copy link
Member Author

hohwille commented Nov 26, 2019

@hohwille
Copy link
Member Author

mojohaus/license-maven-plugin#358
So we just downgrade the plugin to 1.20 and upgrade again once a fix is released.

@hohwille
Copy link
Member Author

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
Copy link
Member Author

See devonfw/ide#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 added a commit that referenced this issue Nov 26, 2019
@hohwille
Copy link
Member Author

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
Copy link
Member Author

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:16 h

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

@hohwille
Copy link
Member Author

Done and released to maven central.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant