You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Olivier Lamy <ol...@apache.org> on 2019/07/07 23:40:39 UTC

Re: [maven-site-plugin] 01/01: [MSITE-844] Downgrade to Java 7

Please update the jira[1] with a more descriptive title really saying what
it does. (maybe saying "We are not ready to use java 8 that's modern for
us..")
Sorry to be so sarcastic but It's really ridiculous "Back to the future"
change......
Please note first I wanted to veto this commit but honestly I don't want to
waste my time.
With such change we clearly say to potential contributors they will be
stuck to use old java if they want to help contribute/contribute

[1] https://issues.apache.org/jira/browse/MSITE-843


On Mon, 8 Jul 2019 at 03:53, <mi...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> michaelo pushed a commit to branch MSITE-844
> in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git
>
> commit 435b018720c83688f6223d7b490cec4442439600
> Author: tibordigana <ti...@apache.org>
> AuthorDate: Fri Jul 5 12:47:53 2019 +0200
>
>     [MSITE-844] Downgrade to Java 7
>
>     This closes #10
> ---
>  Jenkinsfile                                        |  2 +-
>  pom.xml                                            |  2 +-
>  .../maven/plugins/site/deploy/SiteStageMojo.java   | 14 +++++++----
>  .../site/render/AbstractSiteRenderingMojo.java     | 28
> ++++++++++++----------
>  4 files changed, 27 insertions(+), 19 deletions(-)
>
> diff --git a/Jenkinsfile b/Jenkinsfile
> index 81caf8c..5a994fd 100644
> --- a/Jenkinsfile
> +++ b/Jenkinsfile
> @@ -17,4 +17,4 @@
>   * under the License.
>   */
>
> -asfMavenTlpPlgnBuild(jdk:['8','11','12'], maven:['3.0.x', '3.2.x',
> '3.3.x', '3.5.x'])
> +asfMavenTlpPlgnBuild(jdk:['7','8','11','12'], maven:['3.0.x', '3.2.x',
> '3.3.x', '3.5.x'])
> diff --git a/pom.xml b/pom.xml
> index 4e749b9..13db5f1 100644
> --- a/pom.xml
> +++ b/pom.xml
> @@ -196,7 +196,7 @@ under the License.
>
>    <properties>
>      <mavenVersion>3.0</mavenVersion>
> -    <javaVersion>8</javaVersion>
> +    <javaVersion>7</javaVersion>
>      <!-- for dependencies -->
>      <doxiaVersion>1.9</doxiaVersion>
>      <doxiaSitetoolsVersion>1.9.1</doxiaSitetoolsVersion>
> diff --git
> a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> index c3d10ab..a9b8848 100644
> --- a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> +++ b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> @@ -164,10 +164,14 @@ public class SiteStageMojo
>              return null;
>          }
>
> -        return reactorProjects //
> -            .stream() //
> -            .filter( mavenProject -> mavenProject.isExecutionRoot() ) //
> -            .findFirst().get();
> -
> +        // todo Lambda Java 1.8
> +        for ( MavenProject reactorProject : reactorProjects )
> +        {
> +            if ( reactorProject.isExecutionRoot() )
> +            {
> +                return reactorProject;
> +            }
> +        }
> +        return null;
>      }
>  }
> diff --git
> a/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> b/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> index 0d89700..7336d0f 100644
> ---
> a/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> +++
> b/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> @@ -61,7 +61,6 @@ import java.util.LinkedHashMap;
>  import java.util.List;
>  import java.util.Locale;
>  import java.util.Map;
> -import java.util.stream.Collectors;
>
>  import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
>
> @@ -231,8 +230,7 @@ public abstract class AbstractSiteRenderingMojo
>      protected List<MavenReportExecution> getReports()
>          throws MojoExecutionException
>      {
> -        List<MavenReportExecution> allReports;
> -
> +        final List<MavenReportExecution> allReports;
>          if ( isMaven3OrMore() )
>          {
>              // Maven 3
> @@ -257,18 +255,24 @@ public abstract class AbstractSiteRenderingMojo
>          else
>          {
>              // Maven 2
> -            // [olamy] do we still need Maven2 support??
> -            allReports = reports.stream()
> -                .map( report -> new MavenReportExecution( report ) )
> -                .collect( Collectors.toList() );
> +            allReports = new ArrayList<>( reports.size() );
> +            for ( MavenReport report : reports )
> +            {
> +                allReports.add( new MavenReportExecution( report ) );
> +            }
>          }
>
>          // filter out reports that can't be generated
> -
> -        return allReports.stream() //
> -            .filter( mavenReportExecution ->
> mavenReportExecution.canGenerateReport() ) //
> -            .collect( Collectors.toList() );
> -
> +        // todo Lambda Java 1.8
> +        List<MavenReportExecution> reportExecutions = new ArrayList<>(
> allReports.size() );
> +        for ( MavenReportExecution exec : allReports )
> +        {
> +            if ( exec.canGenerateReport() )
> +            {
> +                reportExecutions.add( exec );
> +            }
> +        }
> +        return reportExecutions;
>      }
>
>      /**
>
>

-- 
Olivier Lamy
http://twitter.com/olamy | http://linkedin.com/in/olamy

Re: [maven-site-plugin] 01/01: [MSITE-844] Downgrade to Java 7

Posted by Olivier Lamy <ol...@apache.org>.
On Mon, 8 Jul 2019 at 17:31, Tibor Digana <ti...@apache.org> wrote:

> Hello Olivier,
>
> After seen the repo, it was obvious that Jetty was developed in three code
> lines namely 9.2.x, 9.3.x and 9.4.x.
> The next fact is that the Maven team agreed to use Java compiler 1.7. The
> user can use JDK 1.8 or higher with security patches.
> These two facts mean that we can stick to the minimum requirements and
> atill the user wil have the most modern jetty-security artifact.
>
> Nobody said that Maven does not want to modernize code but we obviously do
> it in some stages.
> We first modernized Maven and plugins with Java 1.7 and there was a strong
> reason - NIO2.
> I remember that we could not solve file system I/O issues related to the
> implementation of JDK 1.8 without upgrading the compiler to Java 1.7.
>
> Not sure if it is not visible enough but I see that Maven 3.7.0 is
> enclosing plugins with Java 1.7.
> Especially, the Maven lifecycle plugins are important, like the
> maven-site-plugin.


> I have no idea when the team want to cut the release of Maven 3.7.0 and
> consequently the plugins based on Java 1.8 but I hope it will be soon.
> I understand it this way, the sooner we finish Maven 3.7.0 the sooner we
> trigger Java compiler 1.8 in plugins and we would not have these conflicts.
> I do not think that somebody would not allow you updating the table in
> MNG-6169 with good fixes of maven-site-plugin.
>

AFAIK site plugin is not part of the default lifecycle. so not part
of MNG-6169...
Or maybe I missed something?


>
> Cheers
> Tibor17
>
>
>
> On Mon, Jul 8, 2019 at 1:41 AM Olivier Lamy <ol...@apache.org> wrote:
>
> > Please update the jira[1] with a more descriptive title really saying
> what
> > it does. (maybe saying "We are not ready to use java 8 that's modern for
> > us..")
> > Sorry to be so sarcastic but It's really ridiculous "Back to the future"
> > change......
> > Please note first I wanted to veto this commit but honestly I don't want
> to
> > waste my time.
> > With such change we clearly say to potential contributors they will be
> > stuck to use old java if they want to help contribute/contribute
> >
> > [1] https://issues.apache.org/jira/browse/MSITE-843
> >
> >
> > On Mon, 8 Jul 2019 at 03:53, <mi...@apache.org> wrote:
> >
> > > This is an automated email from the ASF dual-hosted git repository.
> > >
> > > michaelo pushed a commit to branch MSITE-844
> > > in repository
> https://gitbox.apache.org/repos/asf/maven-site-plugin.git
> > >
> > > commit 435b018720c83688f6223d7b490cec4442439600
> > > Author: tibordigana <ti...@apache.org>
> > > AuthorDate: Fri Jul 5 12:47:53 2019 +0200
> > >
> > >     [MSITE-844] Downgrade to Java 7
> > >
> > >     This closes #10
> > > ---
> > >  Jenkinsfile                                        |  2 +-
> > >  pom.xml                                            |  2 +-
> > >  .../maven/plugins/site/deploy/SiteStageMojo.java   | 14 +++++++----
> > >  .../site/render/AbstractSiteRenderingMojo.java     | 28
> > > ++++++++++++----------
> > >  4 files changed, 27 insertions(+), 19 deletions(-)
> > >
> > > diff --git a/Jenkinsfile b/Jenkinsfile
> > > index 81caf8c..5a994fd 100644
> > > --- a/Jenkinsfile
> > > +++ b/Jenkinsfile
> > > @@ -17,4 +17,4 @@
> > >   * under the License.
> > >   */
> > >
> > > -asfMavenTlpPlgnBuild(jdk:['8','11','12'], maven:['3.0.x', '3.2.x',
> > > '3.3.x', '3.5.x'])
> > > +asfMavenTlpPlgnBuild(jdk:['7','8','11','12'], maven:['3.0.x', '3.2.x',
> > > '3.3.x', '3.5.x'])
> > > diff --git a/pom.xml b/pom.xml
> > > index 4e749b9..13db5f1 100644
> > > --- a/pom.xml
> > > +++ b/pom.xml
> > > @@ -196,7 +196,7 @@ under the License.
> > >
> > >    <properties>
> > >      <mavenVersion>3.0</mavenVersion>
> > > -    <javaVersion>8</javaVersion>
> > > +    <javaVersion>7</javaVersion>
> > >      <!-- for dependencies -->
> > >      <doxiaVersion>1.9</doxiaVersion>
> > >      <doxiaSitetoolsVersion>1.9.1</doxiaSitetoolsVersion>
> > > diff --git
> > > a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> > > b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> > > index c3d10ab..a9b8848 100644
> > > ---
> > a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> > > +++
> > b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> > > @@ -164,10 +164,14 @@ public class SiteStageMojo
> > >              return null;
> > >          }
> > >
> > > -        return reactorProjects //
> > > -            .stream() //
> > > -            .filter( mavenProject -> mavenProject.isExecutionRoot() )
> //
> > > -            .findFirst().get();
> > > -
> > > +        // todo Lambda Java 1.8
> > > +        for ( MavenProject reactorProject : reactorProjects )
> > > +        {
> > > +            if ( reactorProject.isExecutionRoot() )
> > > +            {
> > > +                return reactorProject;
> > > +            }
> > > +        }
> > > +        return null;
> > >      }
> > >  }
> > > diff --git
> > >
> >
> a/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> > >
> >
> b/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> > > index 0d89700..7336d0f 100644
> > > ---
> > >
> >
> a/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> > > +++
> > >
> >
> b/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> > > @@ -61,7 +61,6 @@ import java.util.LinkedHashMap;
> > >  import java.util.List;
> > >  import java.util.Locale;
> > >  import java.util.Map;
> > > -import java.util.stream.Collectors;
> > >
> > >  import static
> org.apache.maven.shared.utils.logging.MessageUtils.buffer;
> > >
> > > @@ -231,8 +230,7 @@ public abstract class AbstractSiteRenderingMojo
> > >      protected List<MavenReportExecution> getReports()
> > >          throws MojoExecutionException
> > >      {
> > > -        List<MavenReportExecution> allReports;
> > > -
> > > +        final List<MavenReportExecution> allReports;
> > >          if ( isMaven3OrMore() )
> > >          {
> > >              // Maven 3
> > > @@ -257,18 +255,24 @@ public abstract class AbstractSiteRenderingMojo
> > >          else
> > >          {
> > >              // Maven 2
> > > -            // [olamy] do we still need Maven2 support??
> > > -            allReports = reports.stream()
> > > -                .map( report -> new MavenReportExecution( report ) )
> > > -                .collect( Collectors.toList() );
> > > +            allReports = new ArrayList<>( reports.size() );
> > > +            for ( MavenReport report : reports )
> > > +            {
> > > +                allReports.add( new MavenReportExecution( report ) );
> > > +            }
> > >          }
> > >
> > >          // filter out reports that can't be generated
> > > -
> > > -        return allReports.stream() //
> > > -            .filter( mavenReportExecution ->
> > > mavenReportExecution.canGenerateReport() ) //
> > > -            .collect( Collectors.toList() );
> > > -
> > > +        // todo Lambda Java 1.8
> > > +        List<MavenReportExecution> reportExecutions = new ArrayList<>(
> > > allReports.size() );
> > > +        for ( MavenReportExecution exec : allReports )
> > > +        {
> > > +            if ( exec.canGenerateReport() )
> > > +            {
> > > +                reportExecutions.add( exec );
> > > +            }
> > > +        }
> > > +        return reportExecutions;
> > >      }
> > >
> > >      /**
> > >
> > >
> >
> > --
> > Olivier Lamy
> > http://twitter.com/olamy | http://linkedin.com/in/olamy
> >
>


-- 
Olivier Lamy
http://twitter.com/olamy | http://linkedin.com/in/olamy

Re: [maven-site-plugin] 01/01: [MSITE-844] Downgrade to Java 7

Posted by Tibor Digana <ti...@apache.org>.
Hello Olivier,

After seen the repo, it was obvious that Jetty was developed in three code
lines namely 9.2.x, 9.3.x and 9.4.x.
The next fact is that the Maven team agreed to use Java compiler 1.7. The
user can use JDK 1.8 or higher with security patches.
These two facts mean that we can stick to the minimum requirements and
atill the user wil have the most modern jetty-security artifact.

Nobody said that Maven does not want to modernize code but we obviously do
it in some stages.
We first modernized Maven and plugins with Java 1.7 and there was a strong
reason - NIO2.
I remember that we could not solve file system I/O issues related to the
implementation of JDK 1.8 without upgrading the compiler to Java 1.7.

Not sure if it is not visible enough but I see that Maven 3.7.0 is
enclosing plugins with Java 1.7.
Especially, the Maven lifecycle plugins are important, like the
maven-site-plugin.

I have no idea when the team want to cut the release of Maven 3.7.0 and
consequently the plugins based on Java 1.8 but I hope it will be soon.
I understand it this way, the sooner we finish Maven 3.7.0 the sooner we
trigger Java compiler 1.8 in plugins and we would not have these conflicts.
I do not think that somebody would not allow you updating the table in
MNG-6169 with good fixes of maven-site-plugin.

Cheers
Tibor17



On Mon, Jul 8, 2019 at 1:41 AM Olivier Lamy <ol...@apache.org> wrote:

> Please update the jira[1] with a more descriptive title really saying what
> it does. (maybe saying "We are not ready to use java 8 that's modern for
> us..")
> Sorry to be so sarcastic but It's really ridiculous "Back to the future"
> change......
> Please note first I wanted to veto this commit but honestly I don't want to
> waste my time.
> With such change we clearly say to potential contributors they will be
> stuck to use old java if they want to help contribute/contribute
>
> [1] https://issues.apache.org/jira/browse/MSITE-843
>
>
> On Mon, 8 Jul 2019 at 03:53, <mi...@apache.org> wrote:
>
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > michaelo pushed a commit to branch MSITE-844
> > in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git
> >
> > commit 435b018720c83688f6223d7b490cec4442439600
> > Author: tibordigana <ti...@apache.org>
> > AuthorDate: Fri Jul 5 12:47:53 2019 +0200
> >
> >     [MSITE-844] Downgrade to Java 7
> >
> >     This closes #10
> > ---
> >  Jenkinsfile                                        |  2 +-
> >  pom.xml                                            |  2 +-
> >  .../maven/plugins/site/deploy/SiteStageMojo.java   | 14 +++++++----
> >  .../site/render/AbstractSiteRenderingMojo.java     | 28
> > ++++++++++++----------
> >  4 files changed, 27 insertions(+), 19 deletions(-)
> >
> > diff --git a/Jenkinsfile b/Jenkinsfile
> > index 81caf8c..5a994fd 100644
> > --- a/Jenkinsfile
> > +++ b/Jenkinsfile
> > @@ -17,4 +17,4 @@
> >   * under the License.
> >   */
> >
> > -asfMavenTlpPlgnBuild(jdk:['8','11','12'], maven:['3.0.x', '3.2.x',
> > '3.3.x', '3.5.x'])
> > +asfMavenTlpPlgnBuild(jdk:['7','8','11','12'], maven:['3.0.x', '3.2.x',
> > '3.3.x', '3.5.x'])
> > diff --git a/pom.xml b/pom.xml
> > index 4e749b9..13db5f1 100644
> > --- a/pom.xml
> > +++ b/pom.xml
> > @@ -196,7 +196,7 @@ under the License.
> >
> >    <properties>
> >      <mavenVersion>3.0</mavenVersion>
> > -    <javaVersion>8</javaVersion>
> > +    <javaVersion>7</javaVersion>
> >      <!-- for dependencies -->
> >      <doxiaVersion>1.9</doxiaVersion>
> >      <doxiaSitetoolsVersion>1.9.1</doxiaSitetoolsVersion>
> > diff --git
> > a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> > b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> > index c3d10ab..a9b8848 100644
> > ---
> a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> > +++
> b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
> > @@ -164,10 +164,14 @@ public class SiteStageMojo
> >              return null;
> >          }
> >
> > -        return reactorProjects //
> > -            .stream() //
> > -            .filter( mavenProject -> mavenProject.isExecutionRoot() ) //
> > -            .findFirst().get();
> > -
> > +        // todo Lambda Java 1.8
> > +        for ( MavenProject reactorProject : reactorProjects )
> > +        {
> > +            if ( reactorProject.isExecutionRoot() )
> > +            {
> > +                return reactorProject;
> > +            }
> > +        }
> > +        return null;
> >      }
> >  }
> > diff --git
> >
> a/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> >
> b/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> > index 0d89700..7336d0f 100644
> > ---
> >
> a/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> > +++
> >
> b/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
> > @@ -61,7 +61,6 @@ import java.util.LinkedHashMap;
> >  import java.util.List;
> >  import java.util.Locale;
> >  import java.util.Map;
> > -import java.util.stream.Collectors;
> >
> >  import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
> >
> > @@ -231,8 +230,7 @@ public abstract class AbstractSiteRenderingMojo
> >      protected List<MavenReportExecution> getReports()
> >          throws MojoExecutionException
> >      {
> > -        List<MavenReportExecution> allReports;
> > -
> > +        final List<MavenReportExecution> allReports;
> >          if ( isMaven3OrMore() )
> >          {
> >              // Maven 3
> > @@ -257,18 +255,24 @@ public abstract class AbstractSiteRenderingMojo
> >          else
> >          {
> >              // Maven 2
> > -            // [olamy] do we still need Maven2 support??
> > -            allReports = reports.stream()
> > -                .map( report -> new MavenReportExecution( report ) )
> > -                .collect( Collectors.toList() );
> > +            allReports = new ArrayList<>( reports.size() );
> > +            for ( MavenReport report : reports )
> > +            {
> > +                allReports.add( new MavenReportExecution( report ) );
> > +            }
> >          }
> >
> >          // filter out reports that can't be generated
> > -
> > -        return allReports.stream() //
> > -            .filter( mavenReportExecution ->
> > mavenReportExecution.canGenerateReport() ) //
> > -            .collect( Collectors.toList() );
> > -
> > +        // todo Lambda Java 1.8
> > +        List<MavenReportExecution> reportExecutions = new ArrayList<>(
> > allReports.size() );
> > +        for ( MavenReportExecution exec : allReports )
> > +        {
> > +            if ( exec.canGenerateReport() )
> > +            {
> > +                reportExecutions.add( exec );
> > +            }
> > +        }
> > +        return reportExecutions;
> >      }
> >
> >      /**
> >
> >
>
> --
> Olivier Lamy
> http://twitter.com/olamy | http://linkedin.com/in/olamy
>