Groovyc: unable to resolve class geb.spock.GebReportingSpec - maven

I'm using IntelliJ IDEA 14.0.2 Ultimate and created a Maven project.
Here's my pom file: http://pastebin.com/KQ6ARxj3
So I have this Geb Spec class: http://pastebin.com/AerXgCDh
And in my classpath there are all maven dependencies and those are getting downloaded, everything's at his place. Including: Maven: org.gebish:geb-spock:0.10.0
But when I right-click on my module and select "Make Module [Module]" it starts compiling my source files but stops with this error:
C:\Users\...\MyModule\src\test\groovy\MySpockSpec.groovy
Error:(1, 1) Groovyc: unable to resolve class geb.spock.GebReportingSpec
Why can't the groovy compiler resolve this? Maven builds the project successfull and IntelliJ can resolve everything, so what's wrong with the groovy compiler?

Related

add a Maven dependency

I'm trying to develop a maven workflow guide for myself and I have gone so far to Install Maven, setup a Maven project, compile, package and run the jar file. Now I wish to add a dependency to the project.
After adding the dependency to the pom.xml I compile , package and run the jar, I get an error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/DateTime
I still don' t understand this part of the process. I also tried mvn install and also don' t get where the the dependency files go? Can someone please point me in the right direction?
Source: my test project (so far)

Could not resolve dependencies for project spmf ca.pfv pom.xml

I am working on open source maven project that use several mining dependencies.
after write this command into component mvn clean install I got ERROR in pom.xml file,enter code here that version of spmf is wrong.
<groupId>ca.pfv</groupId>
<artifactId>spmf</artifactId>
<version>2.33</version> // !!!
full error:
omponents-spmanalysis: Could not resolve dependencies for project
info.collide:components-spmanalysis:jar:2.0.0-SNAPSHOT: Failure to
find ca.pfv:spmf:jar:2.33
I tried to use different versions but same error at maven install.

Gradle refers jars but they are not in POM nor in the code links

We migrated our maven code to gradle. When we build, we are getting error as Could not resolve all files for configuration ':***-war:compileClasspath'.
Could not find mockito-core.jar (org.mockito:mockito-core:2.8.9).
We are not referring to this jar itself.. neither we are able to locate in our code nor in pom...
How to figure out?
how to configure gradle to compile code if jar doesn't exist and pom exists in the repository or locally ?
If you can't work out where it's coming from and you don't use it at all, then you can exclude the dependency from all the configurations:
configurations.all*.exclude group: "org.mockito", module: "mockito-core"
If the dependency isn't appearing in the dependency report, then I'm somewhat at a loss as to why Gradle is complaining about it. The only other option I can think of is that some plugin is adding it in a non-standard way.

Spring MVC Module can't reach dependencies in IntelliJ

I've got a multi-module maven project, and one of the module is a spring mvc project. Intellij is telling me that it can't find the dependencies... The dependencies are other modules in the same project, and I'm getting this error:
cannot access blah.de.blah
Interestingly, maven successfully builds the module, so I'm not sure why intellij has a problem. I've tried compiling the project from Intellij.
...I've not clue why but this is what happened:
Intellij had created a directory named 'a.b.c' instead of nesting the packages. I fixed that, re-marked the source directories as sources/tests etc, and the problem went away.

Maven java compile error can not access CommonClassA

Background:
I am developing Maven multi module project.
One of the module is common module needed by other all modules.
This module contain CommonClassA.java.
common module is properly compiled.
It is installed into maven local repository properly.
One of the class(Billtype.java) in other module (EmployeeBilling) refers this class(CommonClassA.java).
Maven Dependency for common module is properly specified in pom.xml of EmployeeBilling module.
Problem:
While compiling EmployeeBilling module it throws
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project EmployeeBilling: Compilation failure
[ERROR] \MyWorkspace\Biz\EmployeeBilling\src\main\java\com\employee\Billtype.java:[79,19] error: cannot access CommonClassA
[ERROR] -> [Help 1]**
Supporting details:
dependency defined in EmployeeBilling> pom.xml:
Other classes from common module seems accessible as no error observed
There are no other errors like Class not found/file not found.
The class CommonCLassA implements Serializable
Same error occurs from Eclipse as well as commond line
I am using M2E plugin
Tools:
jdk1.7.0_02
OS: Windows 7
Eclipse JUNO and apache-maven-3.1.0
Thanks in advance!
If project builds properly using eclipse compiler then it should work with Maven.
Few things to check if its not working with maven:
Manually check in repository that jar is installed properly and it contains your class file.
Try to build project using locally installed Maven instead of maven in eclipse.
Set -DskipTest=true while installing your jar, as it can cause issues at times.
If these steps don't work then show us your pom.
With no more information it's hard to find the cause. But I also had this problems now and then, and there are some things which could go wrong:
Are you using the right JAVA version (everywhere) ?
... and the right java PROVIDER? (Oracle, IBM, OpenJDK) In my case it's often this issue, I'm sometimes bound to IBM JDK, although I try to use Oracle where I can and this sometimes breaks my build.
Is the right maven dependency VERSION used? If you depend on it multiple times, and all in the same (lower than root) dept of dependencies, Maven will just "choose" a version. It could be that thát version is incompatible with your code of thát particular dependency
Skipping tests sometimes WORKS! It has something to do with maven phases and getting stuff ready for using it elsewhere.
Good luck :)
I had the same problem. Even the jar dependency has the required class files. Finally I deleted the local maven repo and restarted the build. Now it worked without any issue.
It looks like you are using an old version of maven-compiler-plugin (v2.3.2).
I suggest you upgrade it to 3.x. it won't magically fix your issue but it will definitely give you better / more detailed error message.

Resources