nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff <jtsw...@gmail.com>
Subject Re: [DISCUSS] NiFi and Java 11
Date Fri, 05 Apr 2019 06:51:24 GMT
Good idea Andy.

I use the community edition of Intellij IDEA (currently 2019.1), and I have
the project's SDK set to Java 11.  I have Intellij IDEA configured to use
an external installation of Maven (3.5.4, installed via homebrew) and when
building with Maven in Intellij IDEA, Maven uses the project-configured
SDK, ultimately building with Java 11.

I use jEnv to switch between various JDK versions when building or running
from the command line.  When using jEnv, after the desired Java
installations are added to jEnv, the "maven" plugin for jEnv should be
activated, so that Maven uses the Java installation set via the jEnv
utility.  Without the "maven" plugin activated, Maven will use the Java
installation configured with the system.  This can be done by running:

*$ jenv enable-plugin maven*
maven plugin activated

You can verify Maven is using the correct Java installation by doing the
following:

*$ jenv versions   # list configured installations*
* system (set by /Users/jeff/.jenv/version)
  1.8
  1.8.0.192
  11.0
  11.0.2
  openjdk64-11.0.2
  oracle64-1.8.0.192
*$ jenv shell 11.0    # set this current shell to use "11.0" which is alias
(along with "11.0.2") of the openjdk64-11.0.2 installation*
*$ mvn -v   # list maven and java version info*
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe;
2018-06-17T14:33:14-04:00)
Maven home: /usr/local/Cellar/maven/3.5.4/libexec
Java version: 11.0.2, vendor: Oracle Corporation, runtime:
/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.3", arch: "x86_64", family: "mac"

There's a profile set up for building on Java 11, called "jigsaw", which
automatically activates when a JDK version greather than 1.8 is used to
build NiFi.

I build NiFi with Maven in Intellij IDEA and on the command line.  One of
the goals I had for Java 11 build compatibility was to keep it simple.
Make Java 11 available to Intellij IDEA, and/or maven, and build NiFi as
usual, letting the auto-activating profile handle configuring build
plugins, extra dependencies (such as JAXB, annotation/activation, etc).

On a side note, while trying to build the WIP Java 11 PR with Java 8, I did
notice some test failures.  I will address these ASAP.

- Jeff

On Thu, Apr 4, 2019 at 6:12 PM Andy LoPresto <alopresto@apache.org> wrote:

> Jeff,
>
> I think it would also be valuable to the community if you could document
> your tooling/setup for verifying the Java 11 build and performance, as this
> may be new to some community members. This doesn’t have to be an
> endorsement of specific products, but I know things like jEnv [1] can help
> with running multiple JVM/JREs at the same time. I am curious to see how
> you configured your IDE of choice and command-line to work with both
> versions. Thanks.
>
>
> [1] http://www.jenv.be/ <http://www.jenv.be/>
>
> Andy LoPresto
> alopresto@apache.org
> alopresto.apache@gmail.com
> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
>
> > On Apr 4, 2019, at 10:12 AM, Kevin Doran <kdoran@apache.org> wrote:
> >
> > Jeff,
> >
> > Thanks for all your work on this and for explaining the path forward.
> > I also support this proposal.
> >
> > I suggest we take the same basic approach for NiFi Registry. That is:
> >
> > - For the current NiFi Registry 0.x line, we maintain Java 8 and 11
> > build compatibility
> > - We perform Java 8 builds (that can run on 8 and 11) for our
> > convenience binaries
> > - We plan to bump the major version at some point in the future in
> > step with NiFi which will move us to requiring Java 11 for Registry as
> > well
> >
> > I've looked at your PRs, and I think getting NiFi Registry to the
> > point that it can run on Java 11 will be much easier than NiFi was
> > given it is a much smaller and simpler project, and it will mostly
> > require a subset of the changes you made for NiFi (Groovy, JaxB
> > dependencies for example).
> >
> > Thanks,
> > Kevin
> >
> > On Thu, Apr 4, 2019 at 12:54 PM Matt Gilman <matt.c.gilman@gmail.com>
> wrote:
> >>
> >> Jeff,
> >>
> >> I think this is a great approach that should help us transition to and
> in
> >> the long run, adopt Java 11. The staggered approach should allow us to
> >> address concerns and any issues we may encounter as we go over time.
> >>
> >> Thanks for putting these together!
> >>
> >> Matt
> >>
> >> On Thu, Apr 4, 2019 at 2:19 AM Jeff <jtswork@gmail.com> wrote:
> >>
> >>> I created a JIRA [1] to track the developer documentation changes.
> Andy,
> >>> thanks for pointing out the specific links; I've added them to the
> JIRA.
> >>>
> >>> [1] https://issues.apache.org/jira/browse/NIFI-6187
> >>>
> >>> On Wed, Apr 3, 2019 at 11:23 PM Sivaprasanna <
> sivaprasanna246@gmail.com>
> >>> wrote:
> >>>
> >>>> Yep. Adding to GitHub template is a great idea.
> >>>>
> >>>> On Thu, 4 Apr 2019 at 5:27 AM, Andy LoPresto <alopresto@apache.org>
> >>> wrote:
> >>>>
> >>>>> We should add that to the Developer Guide [1], Contributor Guide
[2],
> >>>> note
> >>>>> it in the Migration Guide [3] when it takes effect, and include
it in
> >>> the
> >>>>> GitHub PR template as well.
> >>>>>
> >>>>> [1] https://nifi.apache.org/docs/nifi-docs/html/developer-guide.html
> <
> >>>>> https://nifi.apache.org/docs/nifi-docs/html/developer-guide.html>
> >>>>> [2]
> https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide
> >>> <
> >>>>> https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide>
> >>>>> [3]
> >>> https://cwiki.apache.org/confluence/display/NIFI/Migration+Guidance
> >>>> <
> >>>>> https://cwiki.apache.org/confluence/display/NIFI/Migration+Guidance>
> >>>>>
> >>>>>
> >>>>> Andy LoPresto
> >>>>> alopresto@apache.org
> >>>>> alopresto.apache@gmail.com
> >>>>> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
> >>>>>
> >>>>>> On Apr 3, 2019, at 1:16 PM, Sivaprasanna <sivaprasanna246@gmail.com
> >
> >>>>> wrote:
> >>>>>>
> >>>>>> Sounds good to me.
> >>>>>>
> >>>>>> So contributors who bring in new changes are expected to write
the
> >>> code
> >>>>>> that should be compatible with both Java 8 as well as Java 11,
> right?
> >>>>>>
> >>>>>> Do we see anything that we should have in our site that would
help
> >>> the
> >>>>>> contributors/users with this change? Something like a document
that
> >>>>>> explains best practices which a developer should follow so that
the
> >>>>> change
> >>>>>> which the developer is bringing in should run fine in both 8
and 11.
> >>>>>>
> >>>>>> -
> >>>>>> Sivaprasanna
> >>>>>>
> >>>>>> On Thu, 4 Apr 2019 at 12:18 AM, Pierre Villard <
> >>>>> pierre.villard.fr@gmail.com>
> >>>>>> wrote:
> >>>>>>
> >>>>>>> Sounds good to me as well. Given the latest news on Java
8, having
> >>>> the 2
> >>>>>>> PRs merged in would be great!
> >>>>>>>
> >>>>>>> Thanks,
> >>>>>>> Pierre
> >>>>>>>
> >>>>>>> Le mer. 3 avr. 2019 à 20:34, Joe Witt <joe.witt@gmail.com>
a écrit
> >>> :
> >>>>>>>
> >>>>>>>> Jeff
> >>>>>>>>
> >>>>>>>> This seems very reasonable and thorough to me.
> >>>>>>>>
> >>>>>>>> The only short term implication that we'd have to buy
into then is
> >>>> that
> >>>>>>> PRs
> >>>>>>>> going forward need to be able to build on both Java
8 and 11 which
> >>>>> seems
> >>>>>>> a
> >>>>>>>> very fair way to bridge toward moving to Java 11 as
the base
> >>>>> requirement
> >>>>>>> in
> >>>>>>>> the next major release of NiFi (2.x).
> >>>>>>>>
> >>>>>>>> Thanks
> >>>>>>>> Joe
> >>>>>>>>
> >>>>>>>> On Wed, Apr 3, 2019 at 2:19 PM Jeff <jstorck@apache.org>
wrote:
> >>>>>>>>
> >>>>>>>>> I'm reaching out to the community today to propose
a plan for
> >>> moving
> >>>>>>>>> forward with NiFi on Java 11.
> >>>>>>>>>
> >>>>>>>>> There are currently two PRs that deal with Java
11 compatibility.
> >>>> The
> >>>>>>>>> first PR allows NiFi built on Java 8 to be run on
Java 11 [1].
> >>> The
> >>>>>>>> second
> >>>>>>>>> PR allows NiFi to be built on Java 11 and run on
Java 11 [2].
> >>> There
> >>>>>>> are
> >>>>>>>> a
> >>>>>>>>> lot of changes in the second PR, and it will require
a lot of
> >>>> testing
> >>>>>>> due
> >>>>>>>>> to the breadth of changes from dependency upgrades.
 Please take
> a
> >>>>> look
> >>>>>>>> at
> >>>>>>>>> both of these PRs.  The earlier we can get feedback,
the sooner
> we
> >>>> can
> >>>>>>>> get
> >>>>>>>>> Java 11 compatibility in an Apache NiFi release.
> >>>>>>>>>
> >>>>>>>>> I would to discuss with the community the following
plan for
> >>>> upcoming
> >>>>>>>> NiFi
> >>>>>>>>> releases as they pertain to Java 11:
> >>>>>>>>>
> >>>>>>>>> For the 1.x release line, from either 1.10 or 1.11
(depending on
> >>>> when
> >>>>>>>> these
> >>>>>>>>> two PRs are merged to master) and onward, NiFi will
be compatible
> >>>> with
> >>>>>>>> both
> >>>>>>>>> Java 8 and 11 for building and running NiFi:
> >>>>>>>>>
> >>>>>>>>>  - Build on Java 8, run on Java 8
> >>>>>>>>>  - Build on Java 8, run on Java 11
> >>>>>>>>>  - Build on Java 11, run on Java 11
> >>>>>>>>>
> >>>>>>>>> The 1.x release line will contain convenience builds
for Java 8,
> >>> and
> >>>>>>> will
> >>>>>>>>> NOT contain convenience builds created from Java
11.  Users that
> >>>> want
> >>>>>>> to
> >>>>>>>>> run NiFi 1.1x.y on Java 11 with Java 11 bytecode
will have to
> >>> build
> >>>>>>> from
> >>>>>>>>> the released source code.
> >>>>>>>>>
> >>>>>>>>> Once the Java 11 compatibility features [1] [2]
are merged to
> >>>> master,
> >>>>>>> PR
> >>>>>>>>> reviews will require building and testing with Java
8 and Java 11
> >>>>>>> before
> >>>>>>>>> the PR is merged to master. We will add a new build
to our Travis
> >>> CI
> >>>>>>>>> instance to cover building on Java 11, which should
help with the
> >>> PR
> >>>>>>>>> process, since build status from Appveyor and Travis
are shown on
> >>>> the
> >>>>>>> PR.
> >>>>>>>>> This will allow an easier transition to the NiFi
2.x release
> line.
> >>>>>>>>>
> >>>>>>>>> For the 2.x release line, the minimum Java version
would be Java
> >>> 11,
> >>>>> at
> >>>>>>>>> which point developers would be able to start using
Java 11
> >>> language
> >>>>>>>>> features.  Java 12 is not designated to be an LTS
release, with
> >>> its
> >>>>>>>> support
> >>>>>>>>> ending in September 2019.  I would not recommend
making our
> >>> minimum
> >>>>>>> Java
> >>>>>>>>> version a non-LTS Java release unless we are prepared
to do NiFi
> >>>>>>> releases
> >>>>>>>>> to update the minimum Java version before the support
for that
> >>>> version
> >>>>>>> of
> >>>>>>>>> Java ends.
> >>>>>>>>>
> >>>>>>>>> Taking this approach means we can reasonably allow
users to run
> on
> >>>>> Java
> >>>>>>>> 11
> >>>>>>>>> in the 1.x release line, ensure that we do not add
commits which
> >>> are
> >>>>>>> not
> >>>>>>>>> Java 11 compatible, and make it easier to transition
into the 2.x
> >>>> line
> >>>>>>>> for
> >>>>>>>>> NiFi.
> >>>>>>>>>
> >>>>>>>>> - Jeff
> >>>>>>>>>
> >>>>>>>>> [1] https://github.com/apache/nifi/pull/3174
> >>>>>>>>> [2] https://github.com/apache/nifi/pull/3404
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message