Unable to get Groovy version from GroovySystem, trying InvokerHelper - java

we are using groovy on a java + maven project and getting below error during the build:
INFO] Unable to get Groovy version from GroovySystem, trying InvokerHelper.
[ERROR] Your Groovy version (1.1-rc-1) doesn't support compilation. The minimum version of Groovy required is 1.5.0. Skipping compiling.
My pom.xml have this dependency:
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.12</version>
<scope>compile</scope>
</dependency>
Any idea?

try this, it works for me:
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.5.7</version>
<type>pom</type>
</dependency>

I faced the same problem. in my case, groovy-all.jar was corrupted. if it is so you can do followings
remove
$USER_FOLDER\.m2\repository\org\codehaus\groovy\groovy-all
then
Right click on the project click Maven->Update Project
as shown below image.

Related

Using OCL in Maven/Tycho-surefire

I am trying to run a eclipse plugin test that uses OCL, more specifically:
Diagnostic diagnostic = Diagnostician.INSTANCE.validate(modelRoot);
Which works fine if i run it as rightclick -> run as ... -> Eclipse Plugin Test
But if i try to run it via maven (maven install) it fails with the following errormessage:
java.lang.AssertionError: Unable to find delegate to evaluate the 'constraint' on ...
I tried adding
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>org.eclipse.tycho.surefire.junit4</artifactId>
<version>0.14.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.ocl</groupId>
<artifactId>ecore</artifactId>
<version>3.3.0-v20130520-1222</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>ocl</artifactId>
<version>1.1.0-v200706201508</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf.query</groupId>
<artifactId>ocl</artifactId>
<version>1.1.0-v200706071712</version>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>ocl</artifactId>
<version>3.4.0-v20140524-1358</version>
</dependency>
to the tycho dependenncies (in the pom), but without any sucess. I would greatly appreciate any ideas on how to fix this
to run tycho test you have to configure the target platform for the test first, Please refer to this
hope this helps

java.lang.NoClassDefFoundError: org/openqa/selenium/remote/SessionNotFoundException

I am using Firefox 45.0 and Dependency added in pom.xml is
selenium-firefox-driver 2.53.0.
java.lang.NoClassDefFoundError: org/openqa/selenium/remote/SessionNotFoundException
at TestFIles_MDM.Test_Authn.setup(Test_Authn.java:27)
Error is coming for both Firefox and Chrome.
How can I resolve it, it was working last week.
I think you are missing this dependency in pom.xml:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
</dependency>
Check Selenium docs about Maven dependencies.
Voila, It's worked for me.Just updated the selenium-java dependency in pom.xml
<!-- Selenium java-jar dependency -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>
Or here is the link to get the updated version-
https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
Run mvn dependency:tree in your project, and check what is transitively depending on selenium-remote-driver.
In my project, I was correctly depending on selenium-java at 2.53.1, but another test dependency was depending on an older version (2.40.0); that meant my tests were using the 2.40.0 version of selenium-remote-driver at runtime, which causes the java.lang.NoClassDefFoundError: org/openqa/selenium/remote/SessionNotFoundException error.
If you have transitive dependencies on selenium-remote-driver, you have two options for "fixing" them:
Update the artifact that's depending on the older version to either
Not depend on the artifact at all, or
Use the latest version.
Add an entry in your pom.xml's <dependencyManagement> section for selenium-java to peg the artifact at version 2.53.1.
This will affect the version of selenium-java both in your project and all your nested maven dependencies, too; be aware that those nested artifacts may not work well with the latest version!
It's also worth mentioning that selenium-java version 2.53.0 had a Firefox incompatibility problem; version 2.53.1 allegedly fixes that. See http://seleniumsimplified.com/2016/06/use_selenium_webdriver_jar_locally/ for more details.
Hope this helps :)
This happened with me while trying to update to remote driver to 3.0.1 from 2.53.1. I just reverted it back to 2.53.1 and it went away
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>2.53.1</version>
</dependency>
I ran into this too. I changed to the following and it went away.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>4.0.0-alpha-2</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>6.1.0</version>
<scope>provided</scope>
</dependency>

Running an app built with Play in IntteliJ gives error on Maven dependency: Package not found

I'am using IntelliJ with Maven and Play framework.
Made a small app. Using maven to include a dependency. Compiles fine - but dependency gives an error when running: "Error: Package not found"
So, I suspect that the dependency jar must be copied to another folder in order to work? But how and where? Did expect maven to do this automatically? (I have tried to run a maven install)
POM.XML
<dependencies>
<dependency>
<groupId>org.ektorp</groupId>
<artifactId>org.ektorp</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
</dependencies>
Error message in IntelliJ :

IntelliJ error messages for Maven Plugin Annotations

I am getting incorrect error messages in IntelliJ for a Maven plugin I am creating.
I have the following dependencies in my pom:
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
I am using IntelliJ 12.0
The incorrect errors are in the screenshot. does anyone know what can cause this?
the code runs just fine with a clean install
Try to delete your local ~/.m2/repo. And maybe reinstall Intellij without reimporting your old settings and start fresh.

Jena NoClassDefFoundError with Maven

I have a Java Maven project that I developed a while ago and that doesn't work anymore. It uses a parent pom together with another Maven project in which I think the Jena version was changed and it also uses an external library that uses Jena. The Maven dependency is:
<dependency>
<groupId>com.hp.hpl.jena</groupId>
<artifactId>jena</artifactId>
<version>2.6.4</version>
</dependency>
When I execute my tests I get the following errors:
java.lang.NoClassDefFoundError: Could not initialize class
com.hp.hpl.jena.query.ARQ
java.lang.NoClassDefFoundError: org/apache/jena/iri/IRIFactory
at org.openjena.riot.system.PrefixMap.add(PrefixMap.java:54)
at com.hp.hpl.jena.sparql.util.MappingRegistry.addPrefixMapping(MappingRegistry.java:33)
at com.hp.hpl.jena.query.ARQ.init(ARQ.java:449) [...]
The errors are not thrown by my code directly but by the library I include. Can I prevent this by downgrading the Jena version in the parent pom or what can I do here?
P.S.: I now have a minimal code example that reproduces the error (java.lang.NoClassDefFoundError: org/apache/jena/iri/IRIFactory):
import org.junit.Test;
import com.hp.hpl.jena.query.ARQ;
public class DependencyTest
{
#Test
public void testARQ()
{
ARQ a = new ARQ();
}
}
And I guess it comes from this dependency:
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-arq</artifactId>
<version>2.9.1-incubating-SNAPSHOT</version>
</dependency>
I know there is probably a factory instead of a constructor but I guess this still shows where the problem is.
P.S.: I noticed that I had the dependencies "jena", "arq" and "jena-arq":
<dependency>
<groupId>com.hp.hpl.jena</groupId>
<artifactId>arq</artifactId>
<version>2.8.8</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-arq</artifactId>
<version>2.9.1-incubating-SNAPSHOT</version>
</dependency>
dependency>
<groupId>com.hp.hpl.jena</groupId>
<artifactId>jena</artifactId>
<version>2.6.4</version>
</dependency>
So I thought maybe I have too much overlapping dependencies and commented out "jena" and "arq". But I still get the error
java.lang.NoClassDefFoundError: Could not initialize class com.hp.hpl.jena.query.ARQ
at com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.<init> [...]
I also tried out forcing a non-snapshot-version 2.9.0-incubating, but then I still get the NoClassDefFoundError with and without using the "jena" and "arq"-dependencies.
P.P.S.:
I still get the same error even when I use the following dependencies:
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-arq</artifactId>
<version>2.9.0-incubating</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-core</artifactId>
<version>2.7.0-incubating</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-iri</artifactId>
<version>2.7.0-incubating</version>
</dependency>
You can search for the missing class using the Maven Central search application
http://search.maven.org/#search|ga|1|fc%3A%22com.hp.hpl.jena.query.ARQ%22
It demonstrates that the dependency you appear to be missing is:
<dependency>
<groupId>com.hp.hpl.jena</groupId>
<artifactId>arq</artifactId>
<version>2.6.0</version>
</dependency>
Doesn't appear to be a version 2.6.4, but you're probabily best advised to go for a more modern version (This project was recently donated to apache)
Instructions for using Apache Jena with Maven are here:
incubator.apache.org/jena/download/maven.html
Specifying ARQ 2.9.0 as a dependency in your project pom.xml will pull in the other Jena components that you need.
I finally resolved this error by excluding the "jena"-Dependency brought in as a transitive dependency from some library.

Categories