Can't find spock inside of intellij

Thom

I am pretty new to intellij and spock.

I am adding spock testing to my spring boot project using gradle. Here's my build.gradle:

buildscript {
    ext {
        springBootVersion = '1.4.0.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'

jar {
    baseName = 'theta-server'
    version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()
}


dependencies {
    compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    testCompile('org.spockframework:spock-core:1.0-groovy-2.4')
}


eclipse {
    classpath {
         containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
         containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
    }
}

And so I added a spock test such:

package com.heavyweightsoftware.theta.server.controller

/**
 * 
 */
class ThetaControllerTest extends spock.lang.Specification {
    def "Theta"() {

    }
}

But I can't run the test inside my intellij environment because it says "cannot resolve symbol 'spock'"

The build runs fine directly.

Morfic

At times, IJ may not update the project classpath after some changes. It seems that this happens for both Maven POM files as well as Gradle build files. Usually, this is easily solved by forcing a sync with the Reimport all gradle/maven projects button from the appropriate tool window (maven, gradle):

Gradle

Maven

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Grails 2.2.3 Can't Find Spock on Classpath

From Dev

IntelliJ Idea can't find directory

From Dev

IntelliJ debugger can't find a variable

From Dev

IntelliJ can't find classpath test resource

From Dev

IntelliJ can't find any LibGDX packages?

From Dev

Intellij can't find class in library

From Dev

Intellij - worksheet can't find class

From Dev

IntelliJ IDEA can't find project sdk

From Dev

Can't find Json file inside project

From Dev

Can't find tools inside SDK

From Dev

Can't find path of the img inside div

From Dev

Can't find dropdownlist inside gridview

From Dev

imagemagick can't find files inside subdirectory

From Dev

Intellij IDEA can't find a class in successfully imported Maven dependency

From Dev

Can't find C/C++ IntelliJ IDEA Plugin

From Java

Can't find Git local changes in Intellij Idea 2020.1

From Dev

IntelliJ can't find tools.jar without sudo

From Dev

Can't find "Sync Project with Gradle Files" button in IntelliJ IDEA

From Dev

IntelliJ IDEA can't find remote deploy option

From Dev

Intellij scala worksheet can't find project classes

From Dev

Why IntelliJ can't find SBT snapshot dependencies?

From Dev

SonarQube Local Script in IntelliJ can't find mvn (IOException/No such directory)

From Dev

can't find android.Activity class intellij IDEA

From Dev

I can't find maven from "Build Tool" in IntelliJ

From Dev

IntelliJ community can't find Web Application Artifact to generate WAR

From Dev

Can't find "Sync Project with Gradle Files" button in IntelliJ IDEA

From Dev

IntelliJ Java compile can't find symbol of attached modules

From Dev

IntelliJ can't find tools.jar without sudo

From Dev

can't find android.Activity class intellij IDEA

Related Related

HotTag

Archive