I am taking over development of a rather large grails project. The development was initially done in STS however I would like to move to IntelliJ Idea.
Initially I thought this would be a piece-of-cake because of the "integrate-with --intellij" command. This is however not the story :(
The project consist of mulitple grails-plugin projects (Please don't ask me why it was developed this way) and some of them with web-descriptors. I start out by migrating one of these, since this is one of the "main" projects (X).
Each of the developed plugins that X has as a dependecy to Intellij creates as "YinplacePlugin" modules where Y is the plugin name. And this is where the fun begins! The "YinplacePlugin" module created for the Y project has of course a lot dependencies it self. These are, if I look in STS, referred to in $USERHOME$/.grails/project/Y/plugins/xxxx and this path is in STS included in the build-path.
But these depencies FAIL in idea. I CAN use the "grails compile" option from within the project however IntelliJ "Make Project" or "Make Module" fails because of missing references. See below:
The first image shows the failing reference. The second how STS has this on the build path.
So why don't you just add the libraries to the build path? one might ask. Well, I tried. One result:
IDEA hook: Grails not found!
| Error java.lang.NullPointerException
| Error at org.jetbrains.groovy.grails.rt.Agent$2.run(Agent.java:99)
| Error at java.lang.Thread.run(Thread.java:662)
I am out of ideas. Any ideas how to get this to build using "Idea Make Project"? All I want is an IDE without "red-lines" so development will be smooth!
Related
I am new in ant and junit5. I went through several examples ant/junit4. But I did not find a normal example with a pair of ant with junit5. With a pair of ant with junit4 everything works fine. I downloaded the files from the official site of the junit5 https://junit.org/junit5/docs/current/user-guide/ (For Ant, check out the junit5-jupiter-starter-ant project.), but even they give an error at the very beginning(screen attached) I will try to fix them one by one, but I don't think that official repo committed with errors. Maybe I'm doing something wrong. Or maybe gurus suggest some other simple sample with ant/junit5.
Thank you in advance.
I try to run the original sources from https://github.com/junit-team/junit5-samples and expected to at least compile them. But I get plenty of errors.
So this post has 2 questions:
errors on the screenshot
ant+juni5 integration in general
To reproduce the exact issues one should have the same environment, which is at least the OS, Java version & Ant version. The example itself seems to be using the Junit5 ConsoleLauncher, which is one of the way to run the tests. Looking at the errors it looks like the issue is in the project itself, because if it cannot find the 'symbol' #Test then the Junit(5?) is simply not present on the classpath. Maybe this can be a hint to the author to trty to dig a bit more into the issue, particularly looking into the dependencies (jars) included.
Now going back to how to run Junit5 test with Ant, I can recall the "JUnitLauncher" that apache suggests: https://ant.apache.org/manual/Tasks/junitlauncher.html . Note that you should be attentive on the dependencies here as well, there are number of Jars to be included (opentest4j, junit-platform-xyz). Note that this also depends on the installation of Ant in the environment, so for example if you get a NoClassDefFound for JUnitLauncher, this can be solved by using the 'up-to-date' version of Ant: https://ant.apache.org/bindownload.cgi . In case of Linux you can place these Jars in home/your_username/.ant/lib directory, where it will be automatically picked up.
I have a larger Grails project for which I have taken over development. I have used Grails before and one of the features that I found really nice-to-have is the auto-compilation/reloading when developing.
I haven't had to do anything special to make this work in the past, however for some reason it is not triggered for this project.
I do a simple "grails run-app" and modify a file when server is started - nothing! Any suggestions?
Windows 7, Grails 2.0.1, Java 1.6u35
IDE: Groovy Grails Tool Suite 3.1.0.M1 - Based on Eclipse Juno 4.2
Grails command line doesn't seem to properly handle spaces in directory names of GRAILS_HOME or HOME directory.
see:
http://jira.grails.org/browse/GRAILS-7936
it has links to various other related issues.
This comment has a workaround: http://jira.grails.org/browse/GRAILS-7936?focusedCommentId=72170&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-72170 .
Are you using eventCompileStart in scripts/_Events.groovy? That was my problem, see GRAILS-8776 (please comment and vote on that issue if this is your problem so we can get it resolved!).
Commenting out that block cause auto-reloading to start working again for me.
My solution:
Right click on project -> Properties -> Project Facets -> check Java and set it's correct version -> OK
Bingo!
I've been happily developing SpecFlow tests on this machine for a while now. Today when I changed some tests and tried to regenerate them I keep getting
Custom tool error: Could not load file or assembly 'TechTalk.SpecFlow, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies.
I have SpecFlow 1.8.1 installed on my computer and am pulling in the SpecFlow package from NuGet. I've tried reinstalling both of these components with no luck.
Any suggestions as to why this might be happening or where I should go to find more information would be much appreciated.
You need to add reference to the SpecFlow dll into your project AND set its "Copy Local" property to TRUE. Then it should work.
However, if you are trying to run the ms test from TFS, then you may still get this error. (I'm still trying to find out how to fix that.) But at least the above should fix your immediate problem.
I am working on PhoneGap BlackberryWebWorks i have install BlackBerry WebWorks plug-in:2.5.1 and Blackberry WebWorks SDK:2.0.0. and PhoneGap 0.9.4.but while building the project in eclipse i am getting the following error
Errors occurred during the build.
Errors running builder 'Faceted Project Validation Builder' on project 'PhoneGapSample'.
Could not initialize class org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants
I am not getting any idea how to proceed ahead to remove this error.If any one have any idea about this. it will help me to overcome from this error.
Thanks,
Sagar.
Per neo's comment, install Eclipse Java EE Developer Tools using the Eclipse -> Help -> Install new software -> Work with -> (your Eclipse version's download repository. e.g.:) Indigo.
In the filter field type, then checkbox, Eclipse Java EE Developer Tools.
Download, install, boom: no more errors. Well, not that error, anyway, YMMV.
Edit: Mayoayres added a comment below that may apply if you still get this error despite following these instructions. If you find it helpful, upvote his comment!
Right click on your project >>> Properties >>> Project Facets >>> uncheck Static web Module
Hope to help.
Regards,
In eclipse juno there is some cases the project facets doesn't display any contents...it will give a error named "invalid values for project facets"...So there is a need to do the following
project >>> Properties >>> Builders
and uncheck the faceted project validation builder....
The accepted answer didn't work for me, but I found a solution: you need to install into the Eclipse plugins/ directory the .jar for org.eclipse.jst.j2ee.ejb, because it seems like you need it, but Eclipse WST doesn't properly depend on it, so it is not always installed when it should be.
The issue is completely unrelated to PhoneGap or Blackberry development, by the way.
As a more generic answer, this is because you either imported a project which is dependent on uninstalled Eclipse plugins. I had this issue when migrating to Eclipse Juno. The easiest solution, just edit your .project file in a text editor and remove the conflicting elements. Usually, this is in the buildspec or nature section.
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Keep a backup of your project file if you're not sure. You may always delete and recreate your project later on. It's easier to remove those references than to find and install the exact missing plugin versions.
In my case I was using Thymeleaf Eclipse plugin for thymeleaf content assist in my project and got these message in Eclipse Juno,
Errors running builder 'Thymeleaf Validation Builder' on project 'site'
Solution:
Select project
Project -> Properties -> Builders
Uncheck the Thymeleaf Validation Builder
Uncheck the builder corresponding to your error message and hopefully your problem gets resolved.
Hey all,
I'm just starting with Grails in Netbeans (6.9.1). I got a demo working, but each time i change a groovy file i need to build the project, and then select run (ie the equivalent of "grails build" and "grails run-app"). If there is already an instance running, I need to first shut that instance down.
This seems wrong. It seems like i should be able to just change the groovy file, and it would get automagically reloaded. Isn't that the point of groovy?
Is this actually how it's supposed to work in Netbeans? Without getting into an IDE war, do other IDEs do it better? everyone seems to rave about the Grails support in IntelliJ. Is it worth it?
One last point... I noticed that a regular war maven project no longer automatically reloads on an F11 build. Could this be related?
Thanks
--Matthias
Do not expect to have reloading for all your files even by running your grails app through command line.
Depending on which groovy file you have changed, grails run-time auto-reloading will work or not. Indeed:
Files and folders supporting reloading in development mode: gsp files (in view folder), grails services (in service folder), controllers, taglibs, css, i18 resources, javascript files, some config files (like Config.groovy), url mappings. Note that there are some Grails bug when for instance, using spring transactional annotation in Services makes the reloading crashed
Files and folders NOT supporting reloading (and requiring a restart of the application): any code under src/groovy, src/java, Domain classes (under domain directory), some configuration files, changes in plugins, any code under utils folder (if you have any Codec for instance)
So in your case, if you change a controller groovy file AND NetBeans restarts the application, I recommend you to use a separate command line for running grails application and using the IDE for code changes. The only bad side is that you will not use the NetBeans debugger.
Actually this is the way I work with Grails and IntelliJ