实施Swagger-codegen项目-错误:(23,17)无法解决:junit:junit:4.12 [英] Implementing Swagger-codegen project - Error:(23, 17) Failed to resolve: junit:junit:4.12

查看:141
本文介绍了实施Swagger-codegen项目-错误:(23,17)无法解决:junit:junit:4.12的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是个新手,自从我为Android开发以来已经有一段时间了-尚未完全了解gradle文件等.

Hi Im new to swagger and It was a while since I developed for Android - haven't understood all with the gradle files etc.

我陷入了对JUnit 4.12依赖的问题

Im stuck with this problem with dependency to the JUnit 4.12

我有一个项目,不想与使用swagger-codegen生成的项目创建的项目合并

I have a project that I wan't to merge with a project created with a project generated with swagger-codegen

我已经导入了源代码,但是现在我不得不解决Junit:2.14

I have imported the source but now I'm stuck with getting to resolve Junit:2.14

无法解决:junit:junit:4.12

Failed to resolve: junit:junit:4.12

我试图将其添加到gradlebuild不同的方式,并阅读一些您将maven添加为存储库的地方.已导入pom.xml.

I have tried to add it to gradlebuild diffrent ways and read some where that you sould add maven as repositiory. Have imported the pom.xml.

在swagger-codegen项目中,有一个名为build.sbt的文件,该文件不在我的项目中.它与该文件有关系吗?不太了解为什么还要再有一个构建文件.

In the swagger-codegen project there's a file called build.sbt thats not in my project. Does it have anything to do with that file? Don't really understand why there should be yet another build file.

应用插件:"com.android.application"

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
  buildToolsVersion "24.0.0"
defaultConfig {
    applicationId "com.xxxxx.app.xxxxx"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"


}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
       }
   }
}

buildscript {
   repositories {
       jcenter()
       maven { url 'http://repo1.maven.org/maven2' }
  }

dependencies {
    classpath 'com.android.tools.build:gradle:1.2.3'
  }
}

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  compile 'com.google.android.gms:play-services-gcm:7.8.0'
  compile 'com.android.support:appcompat-v7:23.4.0'
  compile 'com.android.support:design:23.4.0'
  androidTestCompile 'junit:junit:4.12'

 }

推荐答案

请使用 Swagger Codegen 2.2.0 (最新发布),如果您尚未生成Android API客户端,请执行此操作,因为最新的稳定版本默认使用Volley库(而不是HttpClient)生成Android API客户端(不再主动维护带有HttpClient的Android API客户端.)

Please use Swagger Codegen 2.2.0 (recently released) to generate the Android API client if you've not done so as the latest stable version generates Android API client with the Volley library (instead of HttpClient) by default (Android API client with HttpClient is no longer actively maintained).

您可能还会发现此常见问题解答很有用: https://github.com/swagger-api/swagger-codegen/wiki/FAQ#how-can-i-generate-an-android-sdk

You may also find this FAQ useful: https://github.com/swagger-api/swagger-codegen/wiki/FAQ#how-can-i-generate-an-android-sdk

关于build.sbt文件的问题,另一个名为 sbt 的构建工具使用了该问题,主要由Scala使用.

About your question on the build.sbt file, that's used by another build tool called sbt, mainly used by Scala.

这篇关于实施Swagger-codegen项目-错误:(23,17)无法解决:junit:junit:4.12的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆