2017-08-10 1 views
0

Wenn ich versuche, das gradle Projekt von der Idee zu laufen Ich habe einen FehlerIdea Debug oder laufen

FEHLER: Erstellen Sie mit einer Ausnahme fehlgeschlagen.

  • Was schief gelaufen ist: 'Anwendung ausführen' Aufgabe nicht in Stammprojekt 'App-Suche' gefunden.

  • Versuchen Sie: Führen Sie Aufgaben aus, um eine Liste der verfügbaren Aufgaben zu erhalten. Führen Sie die Option --stacktrace aus, um den Stack-Trace abzurufen. Führen Sie die Option --info oder --debug aus, um mehr Protokollausgaben zu erhalten. CREATE BILD BUILD FAILED

Gesamtzeit: 0,153 Sekunden Aufgabe 'run SearchApplication' nicht in root Projekt 'App-Suche' gefunden.

Bitte, wie man es löst.?

+0

ich die gleiche Frage hier gefunden habe - aber keine Antworten http://techqa.info/programming/question/41475477/task-%27run % 27-not-found-in-root-project-% 27 ...% 27 –

+0

Gibt Ihr build.gradle das 'application'-Plugin und auch' mainClassName' an? – Bajal

+0

Vielleicht möchten Sie hier Ihre build.gradle posten – Bajal

Antwort

0

Dies ist der wichtigste Teil meines build.gradle

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 
     } 
    } 
Verwandte Themen