Groovy files throwing ClassNotFoundException in Java Spring Boot application - java

I have updated my STS to v4 few days ago,since then I unable to run my application which has groovy files.
I have installed Groovy Development plugin and tried to build the project using the maven command "clean install".
Maven build has been successfully executed, but when I started my project it throws that the Groovy class has not found exception.
I tried cleaning the project many times, but getting the same ClassNotFoundException for the Groovy classes.
My STS v4 installation details:
Java Build path details:
Error Details, while I am running the project:
That parser class is the groovy class which throws ClassNotFoundException.
Moreover, I the project explorer some strange icon is shown next to those kind of groovy files.
I am also attaching the maven build details,
these build information shows that those groovy files are compiled successfully, but still it throws ClassNotFoundException while starting the application.
NOTE: I gave clean - build, "clean compile" and updated maven project more than 15 times. Yet no luck.
Please help me in reSolving this issue SO!

Found the answer!
Compiler mismatch is the culprit here.

Related

Gradle : Unresolved compilation problem: log cannot be resolved in eclipse

I am stuck with a very weird problem.
I have a spring boot project managed by gradle, which has no errors in workspace. But when I run the spring boot application from eclipse (right clicking on #SpringBootApplication file and doing run as java application), it throws the following error:
Application startup failed
java.lang.Error: Unresolved compilation problem:
log cannot be resolved
But the weird thing is, when I run the same application from command line using ./gradle run it works perfectly fine.
Also I have imported few other gradle projects which makes use of lombok and they works perfectly fine from eclipse, so you can assume that lombok is set up perfectly in eclipse.
Just to give you some info, I have already tried the following steps
Refreshed gradle project
cleaned the project and restarted the eclipse
I already have lombok dependency in gradle
Lombok setup is done and other project are able to pick lombok annotations
Downloaded new eclipse version, problem stills exists
I am not able to figure out the problem. Please help!!.

How do I execute a Java app I built with Maven?

I created a Maven project following the quickstart template as described in the Maven doc site. I can build it. However I'm confused: I can't find any instructions for executing an application built with Maven. I did find the suggestion I type java -cp target/Mus-1.0-SNAPSHOT.jar app.App or something similar, but this fails when I added an external dependency to my Maven project.
Surely there must be some kind of Maven command for executing an App.

How can I add Normal Java project capabilities to EJB project in Eclipse (.ear)?

Just started working with EJB (already developed project).
Imported the project from git and converted it to Maven project. However the project looks like a normal folder structure unlike regular java project. I cannot have any eclipse Java capabilities in side those files. Though they are Java files they look like class files to me with different symbol (can see that in image).
It won't compile unless I do maven build. Eclipse not showing any errors for those files even there are compile errors.
Running each time maven kills time and its irritating too.
Any help will be greatly appreciated. How to make that a normal Java project with eclipse compiler capabilities.
What configuration I have to do achieve this ?
Try running the command mvn eclipse:eclipse from the root folder of the project. It will create eclipse configuration files after which the project can be imported in Eclipse.

Running IntelliJ Inspections via Gradle/TeamCity

I am attempting (unsuccessfully) to run IntelliJ Inspections on a java Gradle project in TeamCity. The documentation is a bit confusing; specifically, it states "To run inspections for your project, you must have either an IntelliJ IDEA project file (.ipr) or a project directory (.idea) checked into your version control." However, it also claims support for both Maven (see this post) and Gradle projects, which seems inconsistent with a requirement to commit the IntelliJ project files.
Our team prefers not to commit the IntelliJ project files, and therefore I am attempting to use my build.gradle file and an inspection profile. However, even for the simplest gradle project I can create, I am unable to get IntelliJ inspections to run successfully on TeamCity. Instead, I get this in the log:
[Step 2/2] [ 6968] WARN - .manage.ContentRootDataService - Can't import content roots. Reason: target module (ModuleData: module ':d9cc8a1592d04689:unspecified') is not found at the ide.
Am I attempting the impossible?

Eclipse build errors when using Gradle or Maven?

When using a build manager like Gradle or Maven, my dependencies are being managed correctly, however the Eclipse IDE is unaware of the resolved dependencies so it will still show errors and I cannot build through Eclipse, I have to run a 'build' command through the build manager.
How do you get Eclipse to be aware of the resolved dependencies taken care of by a build manager and running the app through the IDE?
You can generate Eclipse metadata using eclipse plugin distribute with Gradle - http://www.gradle.org/docs/current/userguide/eclipse_plugin.html - this will set up the project with its classpath.
Or install Gradle plugin for Eclipse developed by Pivotal folks.
The question is vague. Using m2e or Gradle plugin for Eclipse developed by Pivotal can lead you to different errors. You should ask exact question, sharing error that you got here on stackoverflow.

Categories

Resources