有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

ARM64架构上的java Travis CI Spring启动应用程序

我有一个问题,Travis的构建没有贯穿始终。但是AMD64的构建运行得非常完美

以下是AMD64 arch上的日志:

$ java -Xmx32m -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~16.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
$ javac -J-Xmx32m -version
javac 1.8.0_252
before_install.1
5.72s$ mvn clean

还有一个是用于ARM64的:

$ java -Xmx32m -version
/home/travis/.travis/functions: line 109: java: command not found
$ javac -J-Xmx32m -version
/home/travis/.travis/functions: line 109: javac: command not found
0.01s$ mvn clean
/home/travis/.travis/functions: line 109: mvn: command not found
The command "mvn clean" failed and exited with 127 during .

而且我的,。特拉维斯。yml看起来像这样:

#we use java
language: java
#we add the java development kit (jdk)
jdk:
- openjdk8

arch:
  - amd64
  - arm64

services:
#Linking Travis CI and Docker
- docker
before_install:
- mvn clean
- echo "$DOCKER_PASSWORD" | docker login  -u "$DOCKER_USERNAME" --password-stdin
- docker pull openjdk:8-jdk-alpine
script:
#We avoid this error :" the job exceeded the maximum log length and has been terminated "
- cp .travis.settings.xml $HOME/.m2/settings.xml
- cat $HOME/.m2/settings.xml
#deploying the app on Docker
- mvn deploy

正如您所见,java、javac和mvn不能正确识别

以下是dockerfile的示例:

# Start with a base image containing Java runtime
FROM openjdk:8-jdk-alpine

# Add Maintainer Info
LABEL maintainer="htl-grieskirchen"

# Add a volume pointing to /tmp
VOLUME /tmp

# Make port 8080 available to the world outside this container
EXPOSE 8080

# The application's jar file
ARG JAR_FILE

# Add the application's jar to the container
ADD ${JAR_FILE} app.jar

# Run the jar file 
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

我希望有人能帮助我。 谢谢大家!


共 (0) 个答案