Total eclipse of maven (with many WTFs)



  • I'm putting this in the help category, because I would really appreciate some hint on how to beat this pile of shit into submission. Feel free to make fun of the components involved though because they are genuine shit.


    So, I have this project that is a forest of Eclipse plugins. The plugins target a Win32-only Java8 Eclipse Mars (ancient) build, because of some dll it calls for some operations, but it does build with maven on a linux-amd64 fine (and is where the build server actually builds it)

    But I need to add some functionality to it, and for that I would really prefer to get the code completion working. So I am trying to open it in Eclipse. Plugins can be developed against different version than you are developing them in, so I am trying to open it with the same Java, a Linux-amd64 Java8, and more recent Eclipse 2020-06. Some problem was reported with 2020-09 for the other, related, project, but 2020-06 is supposed to work.

    Now the instructions say to import the project, recursively, because there is a lot of nested projects, which creates a maze of twisty little projects, all alike. Now the documentation tells me to reduce Preferences > Java > Compiler > Building > Build path problems > Circular dependencies to warning (:wtf:), and we are nearing the first stumbling block…

    Then it tells me to install some Maven support. Go to Preferences > Maven > Discovery > Open Catalog and select and install:

    • m2e-egit
    • tycho configuratior
    • xmlbeans-maven-plugin
    • jaxb

    Now 🚫s:

    1. Two months ago when I tried for the first time, it couldn't find anything “egit”. I found a workaround that Appeared™ to work.
    2. Now when I got back to it (I decided to first do the other tasks that I knew how to get done after that first try), I went back into the dialog and managed to install egit, xmlbeans-something and jaxb-something, but there was no tycho configurator.
    3. After restarting Eclipse, the Maven tab does not appear in Preferences any more!
    4. At startup Eclipse complains about not being able to set up log4j for the “m2e” (maven integration) plugin, but it does not look like a fatal error.
    5. I set up the target and API (in Preferences > Plug-in development) to the correct runtime, but some of the projects are still showing errors, of which I don't know which are the primary ones and which are just the dependent plugins failing because the dependencies did. But this error looks weird:
      API analysis aborted for '⯀⯀⯀⯀⯀⯀⯀⯀⯀⯀⯀⯀⯀⯀⯀⯀⯀' since its build path is incomplete
      How does it conclude the path is incomplete or what does it even mean?

    Any hints on what these errors could mean welcome—none of the people working on the project knows! They have workspaces that almost work, but all of them are slightly broken (and show some errors, though it can still be built with maven), and they treat them like shitted sticks, well aware that when they break, they won't be able to fix it.


  • Discourse touched me in a no-no place

    @Bulb I'm not sure about all of them, but egit is just the git implementation that Eclipse uses (the “e” is for for “eclipse”) and it ships as part of Eclipse. Or at least it did for me the last time I installed afresh (about 18 months ago).

    The xmlbeans-maven-plugin seems old (version 2.3.3 is the most recent release I can find with a quick search, and that's from like 12 years ago) but won't have disappeared. OTOH, jaxb's complicated because it used to ship as part of Java and doesn't any more (and hasn't for a long time now) since it was thought too large and bloated given that many applications didn't need it.

    Mind you, since it all builds without eclipse present, I'd be tempted to ignore the instructions entirely. The best plugin for what you want to do might be completely different from what it used to be…



  • @dkf said in Total eclipse of maven (with many WTFs):

    I'm not sure about all of them, but egit is just the git implementation that Eclipse uses (the “e” is for for “eclipse”) and it ships as part of Eclipse. Or at least it did for me the last time I installed afresh (about 18 months ago).

    The thing is that this isn't the standard Eclipse dialog, but some special ones for the Maven integration (called m2e). So egit does ship with Eclipse, but this is m2e-egit, integration between the integrated maven and the egit—which I don't think should be needed, because maven shouldn't be doing anything with git, but maybe it does.

    @dkf said in Total eclipse of maven (with many WTFs):

    OTOH, jaxb's complicated because it used to ship as part of Java and doesn't any more (and hasn't for a long time now) since it was thought too large and bloated given that many applications didn't need it.

    Well, that's why I am still running both the Eclipse and the project in Java 8. I know Java 11 does not have it.

    The problem seems to be this special dialog for setting up the integrated maven integrations. The dialog that disappeared after the restart…


  • Discourse touched me in a no-no place

    @Bulb said in Total eclipse of maven (with many WTFs):

    The thing is that this isn't the standard Eclipse dialog, but some special ones for the Maven integration (called m2e). So egit does ship with Eclipse, but this is m2e-egit, integration between the integrated maven and the egit—which I don't think should be needed, because maven shouldn't be doing anything with git, but maybe it does.

    All that shit got integrated years ago; m2e is pretty much standard now. (I've got both it and egit in my Eclipse installation on this machine.) I think it's a shame that some of the dependency graph visualisation stuff got lost along the way, but it always was optional and not actually necessary for getting anything done. (I miss the visualisation of Spring configurations more, but that was probably for the best too, given the massive number of beans set up in a typical Spring Boot setup. It's frameworkland, baby!)

    Generally speaking, it sounds like you're following a very old recipe where some parts of it are really outdated. My real advice is to take a few steps back and try to achieve things without the recipe. Only if there's a really complex piece of configuration to do would a specialist plugin be necessary. (Modern m2e is much better at handling configuration itself via standard Maven metadata.)



  • @dkf Well(lll…). There is a couple of problems:

    1. I don't really know what is actually needed, because that project forest is a mess that is mostly undocumented.
    2. It throws some null pointer exceptions apparently from m2e, so I seem to need something from that.


  • @dkf so whatever installed, installed. I am running into these two errors:

    1.  API analysis aborted for 'Something-XMLBeans-Something' since its build path is incomplete
      
    2.  XmlBeans compile failed:
        xml ErrorLoading schema file /path/to/project/core/Superproject/Bflmpsvz-XMLBeans-Something/schema_source/Something/bflmpsvzIFD_Something.xsd
       xml ErrorLoading config file /path/to/project/core/Superproject/Bflmpsvz-XMLBeans-Something/schema_config/default.xsdconfig
       xml ErrorLoading referenced file file:/path/to/project/core/Superproject/Bflmpsvz-XMLBeans/schema_source/Core/bflmpsvz.xsd
       xml ErrorLoading referenced file file:/path/to/project/core/Superproject/Bflmpsvz-XMLBeans/schema_source/w3c/xmlmime.xsd
       xml ErrorLoading referenced file file:/path/to/project/core/Superproject/Bflmpsvz-XMLBeans/schema_source/w3c/xml.xsd
        (org.codehaus.mojo:xmlbeans-maven-plugin:2.3.3:xmlbeans:default:generate-sources)
      
       org.codehaus.mojo.xmlbeans.XmlBeansException: XmlBeans compile failed:
        xml ErrorLoading schema file /path/to/project/core/Superproject/Bflmpsvz-XMLBeans-Something/schema_source/Something/bflmpsvzIFD_Something.xsd
       xml ErrorLoading config file /path/to/project/core/Superproject/Bflmpsvz-XMLBeans-Something/schema_config/default.xsdconfig
       xml ErrorLoading referenced file file:/path/to/project/core/Superproject/Bflmpsvz-XMLBeans/schema_source/Core/bflmpsvz.xsd
       xml ErrorLoading referenced file file:/path/to/project/core/Superproject/Bflmpsvz-XMLBeans/schema_source/w3c/xmlmime.xsd
       xml ErrorLoading referenced file file:/path/to/project/core/Superproject/Bflmpsvz-XMLBeans/schema_source/w3c/xml.xsd
      
               at org.codehaus.mojo.xmlbeans.AbstractXmlBeansPlugin.execute(AbstractXmlBeansPlugin.java:292)
               at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
               at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:332)
               at org.eclipse.m2e.core.internal.embedder.MavenImpl.lambda$8(MavenImpl.java:1379)
               at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
               at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:114)
               at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1378)
               at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:54)
               at org.bitstrings.eclipse.m2e.connectors.xmlbeans.XmlBeansBuildParticipant.build(XmlBeansBuildParticipant.java:52)
               at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:135)
               at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:169)
               at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
               at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$1(MavenBuilder.java:114)
               at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
               at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:114)
               at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$0(MavenBuilder.java:105)
               at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
               at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153)
               at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101)
               at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:88)
               at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:197)
               at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:832)
               at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
               at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
               at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
               at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
               at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
               at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
               at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
               at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
               at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
               at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
               at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
      

    (I checked the mentioned files and they exist).


  • Considered Harmful

    @Bulb oh, good, it's XML! This'll be easy.


  • Discourse touched me in a no-no place

    @Bulb said in Total eclipse of maven (with many WTFs):

     xml ErrorLoading schema file /path/to/project/core/Superproject/Bflmpsvz-XMLBeans-Something/schema_source/Something/bflmpsvzIFD_Something.xsd
    

    Did it actually say what the error was? Or is it just doing “computer says no”? The latter is really unhelpful. Right now, it might be a real fault in the stuff you're trying to compile or it might be a build path problem that you can fix by fiddling with the dependencies or the plugin dependencies, or it might be trying to access some online resource and failing, either for temporary or permanent reasons. (Sometimes you can coax more info out by running Maven in debug mode, which is an option you can pick on the Run Configurations... dialog. It usually doesn't help with a well written plugin, but in this case it might.)

    There's a lot of moving parts.


  • Considered Harmful

    @Bulb burn this. Just burn it the fuck down. Get some characterization tests around the value and burn the rest of this monstrous faff.



  • @dkf said in Total eclipse of maven (with many WTFs):

    @Bulb said in Total eclipse of maven (with many WTFs):

     xml ErrorLoading schema file /path/to/project/core/Superproject/Bflmpsvz-XMLBeans-Something/schema_source/Something/bflmpsvzIFD_Something.xsd
    

    Did it actually say what the error was? Or is it just doing “computer says no”?

    I provided the entirety of the description from the error list (with bits of the project name replaced with Something and Bflmpsvz for anonymization). If there is somewhere else to fish for more details, I don't have the experience with this thing to know where.

    The latter is really unhelpful. Right now, it might be a real fault in the stuff you're trying to compile

    The maven build (run stand-alone from command-line) just compiled it. Or at least I think so; there is some chance that project contains some dead bits that are not built by maven and not really needed, but still get loaded in Eclipse and cause the failures there.

    or it might be a build path problem that you can fix by fiddling with the dependencies or the plugin dependencies,

    The first error (about the path being incomplete) suggests this is indeed the case, but that error is not particularly helpful either (see above).

    or it might be trying to access some online resource and failing, either for temporary or permanent reasons.

    Unlikely. Unless those schemata are not needed (and I think they are), maven (stand-alone from command-line) managed to compile them, so it had to be able to pull any references too. And Eclipse is running in the same environment (started from the same command-line, actually).

    (Sometimes you can coax more info out by running Maven in debug mode, which is an option you can pick on the Run Configurations... dialog. It usually doesn't help with a well written plugin, but in this case it might.)

    Thanks. I'll have a look whether I can find it and switch it.

    There's a lot of moving parts.

    Too many for its own good I'd say.


  • Considered Harmful

    @Bulb you're well convinced it does something useful in there, I assume?


Log in to reply