jide-oss icon indicating copy to clipboard operation
jide-oss copied to clipboard

3.7.6 build fails, maybe because "/home/bourgesl" path is baked into pom.xml

Open apjanke opened this issue 4 years ago • 0 comments

I checked out the 3.7.6 source distribution on my macOS 10.14.6 machine. The build failed using a Java 9 compiler.

[jide-oss-3.7.6] $ javac --version
javac 9.0.4
[jide-oss-3.7.6] $ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< net.janklab.opp:jide-oss >----------------------
[INFO] Building JIDE Common Layer 3.7.4
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ jide-oss ---
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (default) @ jide-oss ---
[INFO] Source directory: /Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/src-jdk8 added.
[INFO] Source directory: /Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/src-apple added.
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ jide-oss ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 108 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ jide-oss ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (compile-java9) @ jide-oss ---
[WARNING] Parameter tasks is deprecated, use target instead
[INFO] Executing tasks

main:
    [javac] Compiling 4 source files to /Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/target/classes-jdk9
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.989 s
[INFO] Finished at: 2020-04-19T01:11:15-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (compile-java9) on project jide-oss: An Ant BuildException has occured: Error running /home/bourgesl/apps/jdk-9//bin/javac compiler
[ERROR] around Ant part ...<javac includeantruntime="false" fork="true" classpath="/Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/target/classes" destdir="/Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/target/classes-jdk9" srcdir="/Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/src-jdk9" executable="/home/bourgesl/apps/jdk-9//bin/javac">... @ 5:425 in /Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/target/antrun/build-main.xml: Cannot run program "/home/bourgesl/apps/jdk-9//bin/javac": error=2, No such file or directory
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[jide-oss-3.7.6] $ grep -r bourgesl *
pom.xml:        <java9.jdk>/home/bourgesl/apps/jdk-9/</java9.jdk>
target/antrun/build-main.xml:  <javac includeantruntime="false" fork="true" classpath="/Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/target/classes" destdir="/Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/target/classes-jdk9" srcdir="/Users/janke/local/repos/janklab-opp/jide-oss/jide-oss-3.7.6/project/jide-oss-3.7.6/src-jdk9" executable="/home/bourgesl/apps/jdk-9//bin/javac">
[jide-oss-3.7.6] $

That /home/bourgesl/ reference doesn't sound very portable.

From the POM:

    <properties>
        <!-- path to JDK9+ -->
        <java9.jdk>/home/bourgesl/apps/jdk-9/</java9.jdk>
        <java9.sourceDirectory>${project.basedir}/src-jdk9</java9.sourceDirectory>
        <java9.build.outputDirectory>${project.build.directory}/classes-jdk9</java9.build.outputDirectory>
        <!-- enable release tasks (javadoc, sources, release) -->
        <skipRelease>true</skipRelease>
    </properties>

Maybe there's a more portable way of defining the path to Java 9? Maybe this should be removed, and just rely on the caller setting up their $PATH and $JAVA_HOME environment variables correctly?

apjanke avatar Apr 19 '20 05:04 apjanke