Scala sbt库依赖项 - 找不到模块错误

时间:2018-05-12 08:53:38

标签: scala sbt

我正在尝试向json4添加依赖项,但是我找不到模块错误。我使用的是scala-version 2.12.4和sbt-version 1.1.1。我的其他依赖项添加似乎以正常方式添加。

这是我在build.sbt中的代码:

scalaVersion := "2.12.4"

libraryDependencies += "io.spray" %% "spray-json" % "1.3.4"

libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % Test

libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.4" % Test

libraryDependencies += "org.json4s" %% "json4s-native" % "3.3.0"

这是我收到的错误消息:

[warn]  module not found: org.json4s#json4s-native_2.12;3.3.0
[warn] ==== local: tried
[warn]   /Users/*****/.ivy2/local/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/json4s/json4s-native_2.12/3.3.0/    json4s-native_2.12-3.3.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /Users/*****/.sbt/preloaded/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////Users/*****/.sbt/preloaded/org/json4s/json4s-native_2.12/3.3.0/    json4s-native_2.12-3.3.0.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.json4s#json4s-native_2.12;3.3.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

帮助表示感谢,谢谢!

1 个答案:

答案 0 :(得分:1)

您需要使用此库的较新版本。

试试这个: S3 bucket -> SNS topic -> SNS topic policy Lambda function -> SNS topic Lambda function -> transcoder pipeline

或某些早期版本,但不是AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Resources: SNSTopic: Type: AWS::SNS::Topic SNSTopicPolicy: Type: AWS::SNS::TopicPolicy Properties: PolicyDocument: Id: MyTopicPolicy Version: '2012-10-17' Statement: - Sid: Statement-id Effect: Allow Principal: AWS: "*" Action: sns:Publish Resource: Ref: SNSTopic Condition: ArnLike: aws:SourceArn: !Join ["-", ['arn:aws:s3:::rawuploads', Ref: 'AWS::StackName']] Topics: - Ref: SNSTopic rawUploads: Type: 'AWS::S3::Bucket' DependsOn: SNSTopicPolicy Properties: BucketName: !Join ["-", ['rawuploads', Ref: 'AWS::StackName']] NotificationConfiguration: TopicConfigurations: - Topic: Ref: "SNSTopic" Event: 's3:ObjectCreated:*' previewAudioFiles: Type: 'AWS::S3::Bucket' generatePreview: Type: AWS::Serverless::Function Properties: FunctionName: !Join ["-", ['generatepreview', Ref: 'AWS::StackName']] Handler: generatePreview.handler Runtime: nodejs6.10 CodeUri: . Environment: Variables: PipelineId: !Ref previewPipeline Events: BucketrawUploads: Type: SNS Properties: Topic: !Ref "SNSTopic" previewPipeline: Type: Custom::ElasticTranscoderPipeline DependsOn: 'rawUploads' Version: '1.0' Properties: ServiceToken: Fn::Join: - ":" - - arn:aws:lambda - Ref: AWS::Region - Ref: AWS::AccountId - function - aws-cloudformation-elastic-transcoder-pipeline-1-0-0 Name: transcoderPipeline InputBucket: !Join ["-", ['arn:aws:s3:::rawuploads', Ref: 'AWS::StackName']] OutputBucket: Ref: previewAudioFiles

链接到版本: http://search.maven.org/#search%7Cga%7C2%7Cg%3A%22org.json4s%22

编辑:此问题与兼容性有关。您使用新版本的Scala和sbt。此库的先前版本与此Scala版本或sbt版本不兼容。