You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Ryan Williams <ry...@runsascoded.com> on 2018/09/04 15:45:42 UTC
Re: Status of IntelliJ with Gradle
Another tip: I saw a bunch of dependencies failing to be resolved correctly
(across several months and IntelliJ versions); here's the relevant YouTrack
issue <https://youtrack.jetbrains.com/issue/IDEA-195908>.
It turned out to be sensitive to certain artifacts being present in my
local Maven repository (~/.m2/repository), Beam attempting to read from
there before Maven Central
<https://github.com/apache/beam/blob/18e8dcce51afe7fdaefe323ac479ef13f3f7898d/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L253-L254>,
and IntelliJ somehow getting into a bad state as a result.
A bunch more details are on the YouTrack issue
<https://youtrack.jetbrains.com/issue/IDEA-195908#focus=streamItem-27-3050838-0-0>,
but commenting out mavenLocal() in BeamModulePlugin.groovy
<https://github.com/apache/beam/blob/18e8dcce51afe7fdaefe323ac479ef13f3f7898d/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L253>
and re-importing the project in IntelliJ "fixed" it, and from a bit of
poking, that fixed state seems sticky: uncommenting mavenLocal() and
re-importing the project has not restored the broken state (though in my
minimal repro of the issue
<https://github.com/ryan-williams/intellij-bugs/tree/IDEA-195908> I could
deterministically enter and exit the broken state based on using
mavenLocal() vs not).
Something to watch out for!
On Thu, Aug 30, 2018 at 12:01 PM Maximilian Michels <mx...@apache.org> wrote:
> Small update, it helps to add the following to the IntelliJ properties:
>
> Help -> Edit Custom Properties
>
> idea.max.intellisense.filesize=5000
>
> This gets rid of the errors due to large generated source files, e.g.
> RunnerApi.java.
>
>
> -Max
>
> On 22.08.18 23:26, Kai Jiang wrote:
> > I encountered same error with Xinyu when I was launching unit tests in
> Intellij. For now, I am only using gradle to test unit tests.
> >
> > Thanks,
> > Kai
> >
> > On 2018/08/22 21:11:06, Xinyu Liu <xi...@gmail.com> wrote:
> >> We experienced the same issues too in intellij after switching to latest
> >> version. I did the trick Luke mentioned before to include the
> >> beam-model-fn-execution and beam-model-job-management jars in the
> dependent
> >> modules to get around compilation. But I cannot get the vendored
> protobuf
> >> working. Seems the RunnerApi is using the original protobuf package,
> and it
> >> causes confusion in intellij if I added the relocated jar. As a result,
> I
> >> have to run and debug only using gradle for now.
> >>
> >> Thanks,
> >> Xinyu
> >>
> >> On Wed, Aug 22, 2018 at 1:45 AM, Maximilian Michels <mx...@apache.org>
> wrote:
> >>
> >>> Thanks Lukasz. I also found that I can never fix all import errors by
> >>> manually adding jars to the IntelliJ library list. It is also not a
> good
> >>> solution because it breaks on reloading the Gradle project.
> >>>
> >>> New contributors might find the errors in IntelliJ distracting. Even
> >>> worse, they might assume the problem is on their side. If we can't fix
> them
> >>> soon, I'd suggest documenting the IntelliJ limitations in the
> contributor
> >>> guide.
> >>>
> >>> On 20.08.18 17:58, Lukasz Cwik wrote:
> >>>
> >>>> Yes, I have the same issues with vendoring. These are the things that
> I
> >>>> have tried without success to get Intellij to import the vendored
> modules
> >>>> correctly:
> >>>> * attempted to modify the idea.module.scopes to only include the
> vendored
> >>>> artifacts (for some reason this is ignored and Intellij is relying on
> the
> >>>> output of its own internal module, nothing I add to the scopes seems
> to
> >>>> impact anything)
> >>>> * modify the generated iml beforehand to add the vendored jar file as
> the
> >>>> top dependency (jar never appears in the modules dependencies)
> >>>>
> >>>> On Mon, Aug 20, 2018 at 8:36 AM Maximilian Michels <mxm@apache.org
> >>>> <ma...@apache.org>> wrote:
> >>>>
> >>>> Thank you Etienne for opening the issue.
> >>>>
> >>>> Anyone else having problems with the shaded Protobuf dependency?
> >>>>
> >>>> On 20.08.18 16:14, Etienne Chauchot wrote:
> >>>> > Hi Max,
> >>>> >
> >>>> > I experienced the same, I had first opened a general ticket
> >>>> > (https://issues.apache.org/jira/browse/BEAM-4418) about
> gradle
> >>>> > improvements and I just split it in several tickets. Here is
> the
> >>>> one
> >>>> > concerning the same issue:
> >>>> https://issues.apache.org/jira/browse/BEAM-5176
> >>>> >
> >>>> > Etienne
> >>>> >
> >>>> > Le lundi 20 août 2018 à 15:51 +0200, Maximilian Michels a
> écrit :
> >>>> >> Hi Beamers,
> >>>> >>
> >>>> >> It's great to see the Beam build system overhauled. Thank you
> >>>> for all
> >>>> >> the hard work.
> >>>> >>
> >>>> >> That said, I've just started contributing to Beam again and
> I feel
> >>>> >> really stupid for not having a fully-functional IDE. I've
> closely
> >>>> >> followed the IntelliJ/Gradle instructions [1]. In the
> terminal
> >>>> >> everything works fine.
> >>>> >>
> >>>> >> First of all, I get warnings like the following and the build
> >>>> fails:
> >>>> >>
> >>>> >> ====
> >>>> >>
> >>>> .../beam/sdks/java/core/src/main/java/org/apache/beam/sdk/pa
> >>>> ckage-info.java:29:
> >>>> >> warning: [deprecation] NonNull in
> >>>> edu.umd.cs.findbugs.annotations has
> >>>> >> been deprecated
> >>>> >> @DefaultAnnotation(NonNull.class)
> >>>> >> ^
> >>>> >> error: warnings found and -Werror specified
> >>>> >> 1 error
> >>>> >> 89 warnings
> >>>> >> =====
> >>>> >>
> >>>> >> Somehow the "-Xlint:-deprecation" compiler flag does not get
> >>>> through but
> >>>> >> "-Werror" does. I can get it to compile by removing the
> >>>> "-Werror" flag
> >>>> >> from BeamModulePlugin but that's obviously not the solution.
> >>>> >>
> >>>> >> Further, once the build succeeds I still have to add the
> relocated
> >>>> >> Protobuf library manually because the one in "vendor" does
> not get
> >>>> >> picked up. I've tried clearing caches / re-adding the
> project /
> >>>> >> upgrading IntelliJ / changing Gradle configs.
> >>>> >>
> >>>> >>
> >>>> >> Is this just me or do you also have similar problems? If so,
> I
> >>>> would
> >>>> >> like to compile a list of possible fixes to help other
> >>>> contributors.
> >>>> >>
> >>>> >>
> >>>> >> Thanks,
> >>>> >> Max
> >>>> >>
> >>>> >>
> >>>> >> Tested with
> >>>> >> - IntelliJ 2018.1.6 and 2018.2.1.
> >>>> >> - MacOS
> >>>> >> - java version "1.8.0_112"
> >>>> >>
> >>>> >> [1] https://beam.apache.org/contribute/intellij/
> >>>> >>
> >>>> >>
> >>>>
> >>>>
> >>> --
> >>> Max
> >>>
> >>
>