android - 使 AndroidAnnotations Maven 设置适应 Gradle

标签 android maven gradle android-annotations

是否可以将 AndroidAnnotations Maven 设置调整到 Gradle 中? http://code.google.com/p/androidannotations/wiki/MavenEclipse 我似乎无法正常工作 我一直收到 com.sun.codemodel#codemodel;2.5-FROZEN-AA: not found

到目前为止我有这个

description = "App"
abbreviation = "App"
version = '1.0.0.BUILD-SNAPSHOT'

buildscript {
    repositories {
        mavenRepo name: 'gradle-android-plugin', urls: 'http://jvoegele.com/maven2/'
        mavenRepo name: 'androidannotations', urls: 'http://repository.excilys.com/content/repositories/releases/'
    }

    def gradleAndroidPluginVersion = '1.0.0'

    dependencies {
        classpath "com.jvoegele.gradle.plugins:android-plugin:$gradleAndroidPluginVersion"
    }
}

apply plugin: 'android'
apply plugin: 'eclipse'
apply plugin: 'idea'

def compatibilityVersion = 1.6
sourceCompatability = compatibilityVersion
targetCompatibility = compatibilityVersion

repositories {
    mavenCentral()
    mavenRepo urls: 'http://maven.springframework.org/snapshot'
    mavenRepo urls: 'http://maven.springframework.org/milestone'
}

def roboguiceVersion = '1.1.1'
def guiceVersion = '2.0-no_aop'
def springAndroidVersion = '1.0.0.M4'
def commonsHttpClientVersion = '3.1'
def jacksonMapperVersion = '1.8.5'
def androidAnnotationsVersion = '2.1'

dependencies {
    compile "org.roboguice:roboguice:$roboguiceVersion"
    compile "com.google.inject:guice:$guiceVersion"
    compile "org.springframework.android:spring-android-rest-template:$springAndroidVersion"
    compile "commons-httpclient:commons-httpclient:$commonsHttpClientVersion"
    compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonMapperVersion"
    compile "com.googlecode.androidannotations:androidannotations:$androidAnnotationsVersion"
    compile group: 'com.googlecode.androidannotations', name: 'androidannotations', version: '2.1', classifier: 'api'
    runtime files('lib/server-standalone.jar')
}

sourceSets {
    main {
        java {
            srcDir 'src'
        }
    }
}

clean {
    delete 'gen'
}

idea {
    module {
        downloadJavadoc = true
    }
    project {
        javaVersion = 'Android 2.2 Platform'
    }
}

androidProcessResources.dependsOn(clean)
eclipse.dependsOn(cleanEclipse)
idea.dependsOn(cleanIdea)

defaultTasks 'assemble'

最佳答案

作为第一个指针,我看不到托管 androidannotations 库的 maven 存储库的声明。

你应该加上http://repository.excilys.com/content/repositories/releases作为 Maven repo :

...
repositories {
    mavenCentral()
    mavenRepo urls: 'http://maven.springframework.org/snapshot'
    mavenRepo urls: 'http://maven.springframework.org/milestone'
    mavenRepo urls: 'http://repository.excilys.com/content/repositories/releases'
}
...

问候

关于android - 使 AndroidAnnotations Maven 设置适应 Gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7343561/

相关文章:

java - 使用 Gradle 的 Spring Boot 项目不运行 spring

android - 应用程序 :packageDebug, Android Studio、Ubuntu 中的 Gradle 错误

Java 应用程序在运行 Spring Boot 时可以工作,但不能与 Apache 一起工作

maven - 在 Jenkins 声明性管道的不同阶段重用对象/属性

java - 防止 checkstyle 在特定的 Maven 子模块中运行

build-automation - 如何将依赖库导出到目录以在 gradle 中部署?

android - 日期/时间选择器 flutter : OK/CANCEL button not visible

用于聊天应用程序的 Android 数据库加载聊天

android - Jenkins 无法存档调试 apk

java - 构建失败,出现异常 : Task '—' not found in root project