首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Idea调试或运行

Idea调试或运行
EN

Stack Overflow用户
提问于 2017-08-10 11:33:38
回答 1查看 83关注 0票数 0

当我试图从Idea运行gradle项目时,我有一个错误

失败:生成失败,出现异常。

  • 哪里出了问题:在根项目“应用程序搜索”中找不到“运行应用程序”任务。
  • 尝试:运行gradle任务以获得可用任务的列表。使用--stacktrace选项运行以获得堆栈跟踪。使用--info或-调试选项运行以获得更多日志输出。创建图像生成失败

总时间:在根项目'app-search‘中找不到0.153秒任务’运行SearchApplication‘。

请解决它。?

EN

回答 1

Stack Overflow用户

发布于 2017-08-11 07:18:09

这是我build.gradle的主要部分

代码语言:javascript
复制
apply plugin: 'application'
    apply plugin: 'java'
    apply plugin: 'docker'
    apply plugin: 'com.github.johnrengelman.shadow'

    sourceCompatibility = 1.8

    ext {
        dropwizardVersion = '1.1.2'
        mainClass = "com.jobservice.search.AppLauncher"
        mapstructVersion = '1.1.0.Final'
    }
    mainClassName = mainClass

    repositories {
        mavenLocal()
        jcenter()
        mavenCentral()
    }


    buildscript {
        repositories { jcenter() }
        dependencies {
            classpath 'se.transmode.gradle:gradle-docker:1.2'
            classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
        }
    }


    // add logging into test stream
    test {
        testLogging.showStandardStreams = true
    }

    dependencies {

        compile group: 'org.bouncycastle', name: 'bcprov-jdk16', version: '1.46'
        compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.1'
        compile group: 'org.slf4j', name: 'slf4j-ext', version: '1.7.25'
        compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
        compile 'com.google.inject:guice:3.0'
        compile group: 'io.swagger', name: 'swagger-jersey2-jaxrs', version: '1.5.15'
        compile group: 'io.swagger', name: 'swagger-annotations', version: '1.5.15'
        compile group: 'com.hubspot.dropwizard', name: 'dropwizard-guice', version: '1.0.6.0'
        compile group: 'org.liquibase', name: 'liquibase-core', version: '3.5.3'

        compile (
                'io.dropwizard:dropwizard-core:' + dropwizardVersion,
                'io.dropwizard:dropwizard-hibernate:' + dropwizardVersion,
                'org.postgresql:postgresql:9.4.1208.jre7',
                'io.dropwizard:dropwizard-testing:' + dropwizardVersion
        )
        compile 'org.mapstruct:mapstruct-jdk8:' + mapstructVersion
        compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'


        testCompile group: 'junit', name: 'junit', version: '4.12'
        testCompile group: 'org.hamcrest', name: 'hamcrest-junit', version: '2.0.0.0'
        testCompile 'org.mockito:mockito-core:2.0.54-beta'
        testCompile group: 'com.h2database', name: 'h2', version: '1.4.194'
        testCompile('org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.23.2') {
            exclude group: 'javax.servlet', module: 'javax.servlet-api'
            exclude group: 'junit', module: 'junit'
        }
    }

    // Configure the shadow jar task
    shadowJar {
        classifier = 'dist'
        baseName = 'jobs-search'
        version = "1.0"
        mergeServiceFiles()
        manifest {
            attributes 'Main-Class': mainClassName
        }
        version = ''
    }
    jar {
        manifest {
            attributes 'Main-Class': mainClassName
        }
    }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45612591

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档