cisco-ie / anx

Advanced NETCONF Explorer: Graphical Explorer for NETCONF / YANG and GNMI/GRPC Telemetry & Java NETCONF 1.1 client library
Apache License 2.0
183 stars 43 forks source link

java compile issue? #26

Open billmania42 opened 4 years ago

billmania42 commented 4 years ago

Hello, I am trying to build this using java11 via "mvn clean package" command and receiving the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project explorer: Compilation failure [ERROR] /home/wmania01/code/anx/explorer/src/main/java/com/cisco/stbarth/netconf/anx/NetconfYangParser.java:[30,45] error: cannot access Revision

sunjiankun126 commented 3 years ago

I met the same problem

maxwifiJames commented 1 week ago

Fix with

FROM debian:buster-slim LABEL maintainer="Steven Barth stbarth@cisco.com"

Copy application source files to the image

COPY anc /src/anc/ COPY explorer /src/explorer/ COPY grpc /src/grpc/ COPY pom.xml /src/

Install Java, Jetty, and Maven

RUN mkdir -p /usr/share/man/man1 && \ apt update && \ apt -y --no-install-recommends install openjdk-11-jdk jetty9 maven

Set JAVA_HOME environment variable to the correct path for ARM architecture

ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 ENV PATH="${JAVA_HOME}/bin:${PATH}"

Set working directory

WORKDIR /src

Verify Java installation and print version information

RUN echo "JAVA_HOME is set to $JAVA_HOME" && \ java -version && \ mvn -v && \ find /usr/lib/jvm -name "java*"

Run Maven commands to clean, package, and generate javadocs

RUN mvn clean package javadoc:javadoc

Copy the WAR file to Jetty's webapps directory and add API docs

RUN cp /src/explorer/target/*.war /var/lib/jetty9/webapps/ROOT.war && \ cp -a /src/anc/target/site/apidocs /var/lib/jetty9/webapps/

Create the yangcache directory and set permissions

RUN mkdir -p /usr/share/yangcache && chmod -R 755 /usr/share/yangcache /var/lib/jetty9/webapps/

Clean up build artifacts and unnecessary packages to reduce image size

RUN rm -rf /var/lib/jetty9/webapps/root /src /root/.m2 && \ apt remove -y maven && apt -y autoremove && apt clean

Set the working directory, expose port 8080, and specify the entry command

WORKDIR / EXPOSE 8080 CMD ["/usr/share/jetty9/bin/jetty.sh", "run"]