jenkinsci / juseppe

Jenkins Update Site Embedded for Plugin Publishing Easily
https://hub.docker.com/r/lanwen/juseppe/
Apache License 2.0
56 stars 20 forks source link

compilation error #46

Closed pcooke2002 closed 5 years ago

pcooke2002 commented 5 years ago

I pulled the latest release, and am trying to build a run-able java jar. I have made sure all nexus dependencies are available. I am getting the following compilation error with "mvn package" or "mvn compile" java version = "1.8.0_192"

ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project juseppe-core: Compilation failure: Compilation failure: ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/util/SignatureGenerator.java:[3,36] package org.apache.commons.io.ou ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/util/SignatureGenerator.java:[4,36] package org.apache.commons.io.ou ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/util/SignatureGenerator.java:[29,19] cannot find symbol ERROR] symbol: class TeeOutputStream ERROR] location: class ru.lanwen.jenkins.juseppe.util.SignatureGenerator ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/util/SignatureGenerator.java:[51,12] cannot find symbol ERROR] symbol: class TeeOutputStream ERROR] location: class ru.lanwen.jenkins.juseppe.util.SignatureGenerator ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/gen/HPI.java:[26,29] package org.apache.commons.io does not exist ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/gen/HPI.java:[27,29] package org.apache.commons.io does not exist ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/util/SignatureGenerator.java:[35,61] cannot find symbol ERROR] symbol: class NullOutputStream ERROR] location: class ru.lanwen.jenkins.juseppe.util.SignatureGenerator ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/util/SignatureGenerator.java:[48,19] cannot find symbol ERROR] symbol: class TeeOutputStream ERROR] location: class ru.lanwen.jenkins.juseppe.util.SignatureGenerator ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/util/SignatureGenerator.java:[48,39] cannot find symbol ERROR] symbol: class TeeOutputStream ERROR] location: class ru.lanwen.jenkins.juseppe.util.SignatureGenerator ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/gen/HPI.java:[182,37] cannot find symbol ERROR] symbol: variable FilenameUtils ERROR] location: class ru.lanwen.jenkins.juseppe.gen.HPI ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/gen/HPI.java:[185,24] cannot find symbol ERROR] symbol: variable FileUtils ERROR] location: class ru.lanwen.jenkins.juseppe.gen.HPI ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/gen/HPI.java:[196,37] cannot find symbol ERROR] symbol: variable FilenameUtils ERROR] location: class ru.lanwen.jenkins.juseppe.gen.HPI ERROR] /C:/Users/L1PXC04/Downloads/juseppe-master/juseppe-master/juseppe-core/src/main/java/ru/lanwen/jenkins/juseppe/gen/HPI.java:[199,24] cannot find symbol ERROR] symbol: variable FileUtils ERROR] location: class ru.lanwen.jenkins.juseppe.gen.HPI

sathomps commented 5 years ago

Please check your local maven repository and make sure the jars are there. Based on the exception above - verify that commons-io\commons-io\1.4 is there and not corrupted.

pcooke2002 commented 5 years ago

hi once I put `

commons-io commons-io 2.4

`

in the juseppe-core/pom.xml and ran

mvn package -DskipTests

everything ran properly

Not sure why tests would not run.

pcooke2002 commented 5 years ago

Hi running juseppe on my system. It is interesting the old jar had
org/apache/commons/lang/exception/NestableRuntimeException.class the new jar does not have the classs in it

The new jar has other Apache commons classes from lang3 and other appache classes.

I am getting the following error when I run "java -jar juseppe.jar"

2018-11-26 18:03:09 WARN FAILED org.eclipse.jetty.server.Server@1f2586d6: java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at ru.lanwen.jenkins.juseppe.gen.Signer.sign(Signer.java:113) at ru.lanwen.jenkins.juseppe.gen.UpdateSiteGen.lambda$withDefaults$5(UpdateSiteGen.java:69) at ru.lanwen.jenkins.juseppe.gen.UpdateSiteGen.lambda$filled$6(UpdateSiteGen.java:77) at java.util.ArrayList.forEach(ArrayList.java:1257) at ru.lanwen.jenkins.juseppe.gen.UpdateSiteGen.filled(UpdateSiteGen.java:77) at ru.lanwen.jenkins.juseppe.gen.UpdateSiteGen.toSave(UpdateSiteGen.java:82) at ru.lanwen.jenkins.juseppe.serve.GenStarter.lifeCycleStarted(GenStarter.java:23) at org.eclipse.jetty.util.component.AbstractLifeCycle.setStarted(AbstractLifeCycle.java:179) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at ru.lanwen.jenkins.juseppe.cli.ServeCommand.unsafeRun(ServeCommand.java:79) at ru.lanwen.jenkins.juseppe.cli.JuseppeCommand.run(JuseppeCommand.java:36) at ru.lanwen.jenkins.juseppe.JuseppeCli.main(JuseppeCli.java:32) Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 24 more Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at ru.lanwen.jenkins.juseppe.gen.Signer.sign(Signer.java:113) at ru.lanwen.jenkins.juseppe.gen.UpdateSiteGen.lambda$withDefaults$5(UpdateSiteGen.java:69) at ru.lanwen.jenkins.juseppe.gen.UpdateSiteGen.lambda$filled$6(UpdateSiteGen.java:77) at java.util.ArrayList.forEach(ArrayList.java:1257) at ru.lanwen.jenkins.juseppe.gen.UpdateSiteGen.filled(UpdateSiteGen.java:77) at ru.lanwen.jenkins.juseppe.gen.UpdateSiteGen.toSave(UpdateSiteGen.java:82) at ru.lanwen.jenkins.juseppe.serve.GenStarter.lifeCycleStarted(GenStarter.java:23) at org.eclipse.jetty.util.component.AbstractLifeCycle.setStarted(AbstractLifeCycle.java:179) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at ru.lanwen.jenkins.juseppe.cli.ServeCommand.unsafeRun(ServeCommand.java:79) at ru.lanwen.jenkins.juseppe.cli.JuseppeCommand.run(JuseppeCommand.java:36) at ru.lanwen.jenkins.juseppe.JuseppeCli.main(JuseppeCli.java:32) Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 24 more

sathomps commented 5 years ago

While using direct dependencies is a better approach, commons-io is a transitive dependency in the core project, you don't need to add that to the pom. Something is still incorrect with your maven repo and resolution of artifacts.

I'd wipe out your local repo and run mvn package -DskipTests -X to see what's going on.

sathomps commented 5 years ago

Closing - please reopen if needed.