SeelabFhdo / lemma

Home of the Language Ecosystem for Modeling Microservice Architecture (LEMMA)
MIT License
33 stars 8 forks source link

Build errors with Maven > 3.6.0 #5

Closed teatwig closed 4 years ago

teatwig commented 4 years ago

I'm starting the build with the build script lemma.sh.

With Maven 3.6.2 and 3.6.3 de.fhdo.lemma.data.datadsl doesn't build and only returns a non-descript NullPointerException as an error. This could be related to this issue and fixed in the upcoming 3.7.0, since I'm getting a similar stacktrace when running Maven with -X:

Stacktrace ``` java.lang.NullPointerException at java.util.Hashtable$Entry.setValue (Hashtable.java:1286) at org.apache.maven.model.interpolation.StringVisitorModelInterpolator$ModelVisitor.visit (StringVisitorModelInterpolator.java:1427) at org.apache.maven.model.interpolation.StringVisitorModelInterpolator$ModelVisitor.visit (StringVisitorModelInterpolator.java:1025) at org.apache.maven.model.interpolation.StringVisitorModelInterpolator$ModelVisitor.visit (StringVisitorModelInterpolator.java:168) at org.apache.maven.model.interpolation.StringVisitorModelInterpolator.interpolateModel (StringVisitorModelInterpolator.java:105) at org.apache.maven.model.building.DefaultModelBuilder.interpolateModel (DefaultModelBuilder.java:789) at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:393) at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom (DefaultArtifactDescriptorReader.java:292) at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor (DefaultArtifactDescriptorReader.java:171) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.resolveCachedArtifactDescriptor (DefaultDependencyCollector.java:541) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.getArtifactDescriptorResult (DefaultDependencyCollector.java:524) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:412) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:365) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:352) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse (DefaultDependencyCollector.java:509) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:461) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:365) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:352) at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:254) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies (DefaultRepositorySystem.java:284) at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:169) at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:243) at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147) at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202) 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 sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) 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) ```

With Maven 3.6.1 de.fhdo.lemma.eclipse.ui.utils (and possibly others) won't build with the following error:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: de.fhdo.lemma.eclipse.ui.utils 0.7.0.qualifier
[ERROR]   Missing requirement: de.fhdo.lemma.eclipse.ui.utils 0.7.0.qualifier requires 'osgi.bundle; com.google.guava 0.0.0' but it could not be found

Everything works fine with Maven 3.6.0 and 3.5.4.

Lemma Version: current master (a400b0cb) Java Version: 11.0.7 Operating System: openSUSE Tumbleweed 20200622

frademacher commented 4 years ago

Hi @teatwig,

Thanks a lot for the bug report!

Maven 3.6.1

Regarding Maven 3.6.1, I can confirm your bug report. Therefore, we used Maven 3.6.0 (in the past) to build LEMMA on various Linux flavors, as well as Mac OS and Windows.

Maven 3.6.3

Unfortunately, however, I cannot reproduce the build problem with Maven 3.6.3. Actually, Maven 3.6.3 is our standard build system for most LEMMA modules (we also use Gradle, though, but only for the Kotlin modules and specifically not for the Eclipse part). In fact, your timing is quite good, because as of today, we rely on a Jenkins-driven and containerized Docker CD pipeline to build and deploy LEMMA. Consequently, you have several (yet undocumented, but we're on it) options to obtain a copy of pre-built LEMMA modules:

First, you may have your Maven POM or Gradle build file point to the Maven repository at https://repository.seelab.fh-dortmund.de/repository/maven-snapshots, which holds the pre-built LEMMA JAR archives of the current master (0.7.0-SNAPSHOT). In case you want to directly install the current master modules of LEMMA in Eclipse (and only Eclipse), you may also rely on the new Eclipse updatesite located at https://repository.seelab.fh-dortmund.de/repository/lemma/.

Second, if you want to build LEMMA locally yourself (with Maven 3.6.3 based on Maven's maven:3.6.3-openjdk-11-slim Docker image), you may use the lemma/build:latest Docker image, which you can either build yourself (cf. the Dockerfile in the repository) or simply pull from our Docker registry. The command to execute LEMMA's build script in the container should be along the lines

docker run -v $YOUR_LEMMA_REPO$:/root lemma/build:latest bash -c "cd /root/build && ./lemma.sh"

with $YOUR_LEMMA_REPO$ pointing to the folder on your hard drive into which you pulled the GitHub repository. After the build, you can find the LEMMA modules within the .m2 folder in $YOUR_LEMMA_REPO$. However, this second approach should be considered somewhat "experimental" and currently has at least two drawbacks:

  1. The owner of the LEMMA modules within the .m2 folder is root. You may specify a different user for the docker run command, but the behavior of the image is completely untested for this case. Otherwise, chown -R is your friend of course.
  2. You will have to install the LEMMA modules from the repo-relative .m2 into your local ~/.m2 repository (cf., e.g., http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html).

Hope this helps!

Cheers, Florian

teatwig commented 4 years ago

Thanks for the quick reply!

Tested the Docker image and the build works fine. Gotta investigate further then what's wrong with my Maven 3.6.3. Also thanks for linking the Maven repository! That will make things easier in the future without having to go through the (long) build process myself.

frademacher commented 4 years ago

Thanks for the quick confirmation!

I'm closing this issue for now. If you can figure out, what's wrong with Maven 3.6.3 on your system, feel free to drop a comment at the closed issue. If we can fix it in our side, we'll have a look at it again.