I've got a grails project in STS. Recently an error has appeared at the project level ( the red [X] on the project) and it warns me everytime I run the project, but I can't see any files/directories showing errors and I've tried cleaning, refreshing dependencies, and even deleting the project and checking it out from SVN again. The project builds fine and runs without any actual errors as far as I can tell.
An additional tips on debugging this? It's basically an annoyance, but it's going to make it easier more me to miss real problems down the line...
Related
I've faced this problem quite a lot lately but I didn't care in the past and decided to rewrite the whole project I'm getting from GitHub but now when the project is enormous I can't do this anymore.
Here is a picture of the problem:
As you see the classes are already in their places but the import still failing I don't know why. I checked my SDK and it's already added so anyone have an idea why this happening?
If it is a Maven project, open the Maven tab and click Reimport all dependencies button.
Another solution is to use the Terminal, just run mvn clean install command.
My eclipse project come from my company versioning system (svn), and I have the same codebase as my colleagues. However, in a number of projects I have an exclamation mark like this .
In the "Problems View" I have tons of Project 'A' is missing required Java project: 'B'. Project A and B are both in eclipse, with no other errors than this.
Every project builds correctly. Sometimes, a generated class isn't properly located by eclipse so I get red lines everywhere in the file, but the maven build still yields 'SUCCESS'.
I've tried refreshing, cleaning, force updating, with no success. I don't know where to look, because everything works fine except the build path that I have no control over (it's all done automatically). pom.xml files are up to date. How do I fix this?
I am running into a problem when trying to duplicate a project in STS.
I am getting lots of error-messages of type
"Import XY cannot be resolved..."
in my code which runs and builds completely fine with maven and which is a more or less exact copy of the original project (with different artifact ID a.s.o. in the corresponding pom) which is shown as error-free.
What I did until now:
I wasn't sure how STS-duplicate works and thought that some configuration may have been duplicated but would have needed some changes, so I created a new project and inserted the code manually in manually new created classes and added the needed dependencies to the pom.
Again this compiles and runs perfectly while still showing the import errors.
Did anyone run into similar problems and has a solution to this?
(I had something similarly strange in the past where STS showed an error on project-level but no file in the project would have an error-indicator.)
Run a Maven -> Update Project..., that should help... :-)
If I run my application (Play 2.3.2) while Eclipse is running I always have strange compilation errors, no class def found errors, class not found errors, etc...
If I exit Eclipse and run my application, everything is working fine. But sometimes it's also working fine while Eclipse is running.
Am I the only one to experience that ? What is the cause ?
I suspect something in Eclipse changes my source files but I can't find what.
Maybe Lombok ?
Thanks.
I have similar problems. Typesafe responded with a solution which I am currently trying out.
https://groups.google.com/forum/#!topic/play-framework/4RnbqEk-muM
Brief summary of the answer by #jroper :
Eclipse doesn't know
how to keep its dirty hands off the same build directory that Play is
using to compile your app - if you have both Play, and the IDE, trying
to compile the same code at the same time, what do you think will
happen? You will see random errors. You should configure Eclipse not
to automatically build your app, or configure it to have different
output directories.
The Play Framework compiles everything to the directory target/scala-2.11/classes. When changing some of these classes, especially any views, causes Activator to auto compile the classes creating new class files. Hitting refresh on the project in Eclipse will update the project and class files in the classes directory causing a rebuild. This should make your compilation errors go away. If you still have issues, take a look at your .classpath file and the Eclipse build path settings.
My coworker is attempting to install STS, groovy/grails onto his PC. He has imported a TFS project which grabbed the source fine. However he is getting lots of build errors that appear to be the result of the Grails Dependencies library being empty. He cleared .ivy2 cache and restarted STS which repopulated the .ivy2 cache. However, the dependencies are still empty under the build path (right click project, build path, libraries tab, expand Grails Dependencies).
He might be able to add them manually, but that doesn't seem like the appropriate solution and may cause issues down the line. Any ideas?
Select "Grails Tools -> Refresh dependencies" from the context menu of your project. Then the dependencies are added.
I had the same problem. It turned out that an undeclared class was causing the problem. One of the STS engineers responded that "if the command "grails compile" fails, then STS will not have the dependency data. This data is produced as a side effect of the compile command. So it doesn't get generated if the compile fails."
Basically, the entire Grails Dependency issue was a red herring. If you look at the Error Log (Window->View->Error Log or Window->View->Other: General->Error Log) check to see there is an undefined that is stopping the grails compile.