gpt4 book ai didi

java - Play Framework 构建不一致

转载 作者:太空狗 更新时间:2023-10-29 22:58:41 25 4
gpt4 key购买 nike

我第一次运行时得到以下堆栈跟踪激活器运行

[warn]  [NOT FOUND  ] org.apache.commons#commons-compress;1.7!commons-compress.jar (1ms)
[warn] ==== activator-launcher-local: tried
[warn] /activator-dist-1.3.9/repository/org.apache.commons/commons-compress/1.7/jars/commons-compress.jar
[warn] [NOT FOUND ] org.tukaani#xz;1.4!xz.jar (0ms)
[warn] ==== activator-launcher-local: tried
[warn] /activator-dist-1.3.9/repository/org.tukaani/xz/1.4/jars/xz.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.apache.commons#commons-compress;1.7!commons-compress.jar
[warn] :: org.tukaani#xz;1.4!xz.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: download failed: org.apache.commons#commons-compress;1.7!commons-compress.jar
download failed: org.tukaani#xz;1.4!xz.jar
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:291)

Full trace here

有时我有机会按重试,当我这样做时它会成功。我正在用 docker 构建它,并希望它每次都能工作。

这是我的配置

build.sbt

name := """swsupplymonitor"""

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
"mysql" % "mysql-connector-java" % "5.1.18",
"com.typesafe.play" %% "anorm" % "2.4.0",
"org.scalatest" %% "scalatest" % "2.2.1" % "test",
"org.scalatestplus" %% "play" % "1.4.0" % "test",
javaJdbc
)

lazy val root = (project in file(".")).enablePlugins(PlayScala)

build.properties

#Activator-generated Properties
#Tue Jul 07 09:30:59 CEST 2015
template.uuid=f5aa99a5-66e6-4ba6-abda-852c14da8938
sbt.version=0.13.8

plugins.sbt

logLevel := Level.Warn


// The Typesafe repository
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")

这是我的 Dockerfile

FROM java:8
MAINTAINER Nils Eriksson
ENV UPDATED_AT=2016-03-19

RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y curl unzip
RUN curl -o ./activator.zip http://downloads.typesafe.com/typesafe-activator/1.3.9/typesafe-activator-1.3.9.zip
RUN unzip activator.zip -d / && rm activator.zip && chmod a+x /activator-dist-1.3.9/bin
ENV PATH $PATH:/activator-dist-1.3.9/bin

EXPOSE 9000 8888
RUN mkdir /app
WORKDIR /app
COPY ./ .

CMD ["activator", "run"]

我用这个命令运行

docker run -di -v $(pwd):/app:rw -p $PORT:9000 --name beacon-backend --link db:db beacon-backend

最佳答案

首先,检查您的连接。未解析的依赖项下载是因为在解析您的依赖项时 sbt 无法连接到远程存储库来下载它们。

如果您通过防火墙进行连接,请检查是否允许此 repo 协议(protocol)。

关于java - Play Framework 构建不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36627511/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com