How do I get .jsp/.xhtml/.html files to trigger a compile/package goal in a Google App Engine + Maven + Eclipse setup? (actually it's the same for IntelliJ & Netbeans)
The .java files cause a compile goal just fine, which causes the target directory to update, which is then picked up by appengine:devserver, but nothing else works.
I've seen lots of people asking this, but no solution.
I'm using the simple GuestBook Maven archetype:
mvn archetype:generate -Dappengine-version=1.9.15
-Dapplication-id=your-app-id -Dfilter=com.google.appengine.archetypes:guestbook-archetype
Followed by:
mvn appengine:devserver
Eclipse Juno is setup to "build automatically", so touching a java file triggers the goal, just nothing else.
Frustrated!
UPDATE: I'm using the GPE for Juno EE.
-- shane
If you install the GPE, you can run from within the eclipse IDE. When running in debug mode, jsp and java file changes will get hot-loaded. You can also use the JRebel plugin for eclipse to save time on redeploys/restarts.
EDIT:
If you're still having trouble, ensure that you have the m2e-wtp plugin installed into your eclipse, it enables a bunch of secret sauce. m2e is now intrinsic, i'm not sure about m2e-wtp. If I look in 'About' for eclipse, I can see a button for wtp. m2e-wtp
For the record, this is actually unnecessarily hard. But once it works, it works.
I feel there should be a better way, but this is a workaround:
Project -> Properties -> Builders
Click "New…" to create a builder that will invoke the mvn binary.
Here's my settings for it.
Location: /usr/local/bin/mvn
Working directory: ${workspace_loc:/} (use browse workspace to populate this)
Arguments: -Dmaven.test.skip=true prepare-package war:exploded (these arguments seem to be the fastest way to produce the exploded war, ~1 second in my case)
In Build Options, deselect "Allocate Console" and select "Launch in background".
Except the 1 second delay, this works flawlessly for me.
Related
I am using Eclipse Mars and I have the following problem.
After the installation of a plugin, the Adoe Flash Builder plugin, it is a plugin that is installed outside Eclipse (executing an installer and selecting the Eclipse folder) I have some problem.
The plugin installation failed (because this plugin is supported only on the 32 bit version of Eclipse). So the plugin was not completly installed.
When I start Eclipse I obtain a lot of error messages caused by this failed installation and it is impossible to me work.
So I have tried to disinstall this plugin but it doesn't give me the possibility to uninstall it (the Uninstall button is disabled).
Here the screenshot where you can see that, selecting the plugin that I want to uninstall, the Uninstall button is disabled:
Why? Can I manually delete this plugin in some way? (I have not directory related to it into my Eclipse folder). It seems that in some way Eclipse have the information of this plugin but that this is not effectively present. How can I remove it? Or is faster reinstall and configure again my environment (Eclipse + SVN plugin + project configuration)
I have tried sometimes to get rid of "messed up" eclipse configurations.
In the end, it just didn't work out. I always ended up throwing away everything.
Besides: Eclipse Neon R2a was released already; so just download that and say goodbye to Mars.
And the real answer (in my opinionated eyes): I decided at some point to enable myself to install eclipse "from scratch" as quickly as possible (for example by having automation where possible; and "checklists" to follow where manual interaction is required). Simply because "installing from scratch" helps avoiding a lot of problems over time.
And while we are talking about eclipse best practices: if your OS is Linux, consider to switch to git-svn instead of SVN. Your machine still talks SVN to the remote SVN server, but you can enjoy the full beauty of git locally. No more SVN plugins, no more hours of waiting for that SVN plugin doing refresh ... I can't tell you how much time that simply change saved for me.
I developed an Eclipse plugin that compiles and runs java code in German. The technique I am using is that I translate the code to English and pass it to Java Compiler and get the results back and print it in the console.
The problem is that the plugin works when I run the plugin from Inside Eclipse but when I install the plugin in Eclipse so that when I open Eclipse it already exists there and start to test if a real user uses my plugin and creates a new Java project and try to the compile button in my plugin it says [The chosen operation is not currently available] ![Here is the the way I run and it opens a new Eclipse application with the installed plugin ]
Any help please
the way you installed your plugin sounds a little weird to me. So at first please try to export your plugin via the Export Wizard.
(Select Export -> Deployable plugins and features from your projects context menu)
Export your project as jar file and copy it to the 'plugin' folder of your eclipse instance.
After that it might be helpful to debug your plugin on OSGI-Level as there might be a problem loading your plugin (at least the error description you have posted indicates that).
Run eclipse with -console -noExit -consoleLog flags to open an OSGI console for debugging. After that try running ss <your-plugin-name> to see what the state of your plugin is.
The output gives you the ID of your plugin and the state it currently has. If the state of your plugin is not ACTIVE try running start <your-plugin-id> to see whether it starts correctly. If there is a problem starting your plugin you should get a respective log message. Feel free to post it here in case you need further help.
Otherwise there are plenty of options what might cause your problems, so maybe its better to try the steps I have described above before getting into details.
If you want to run eclipse plug-in withput using Eclipse Application , then you need to make a Feature project.
Now if your algorithm has something to do with system Path , you must
check Unpack plug-in and you should read the resource accordingly.
Like PLatformUI.getWorkBC() etc..
No other eclipse plug-in (jar) should be inside plugins directory of eclipse of same name of your plug-in. Ensure for this.
I created a new project and working with eclipse (used eclipsify command).
basically, I moved the app directory from an old project to the new one I created.
the problem is that eclipse doesn't recognize the views. I get errors like:
views.html.viewTopic cannot be resolved to a type
I tried to play compile but it didn't help.
so I got 40 errors. all of them connected to the fact that the views aren't compiled and therefore, the eclipse doesn't recognize them (my guess of course).
what can I do?
by the way, the old project compiled and ran without a problem (I used intellij)
For Java Play Framework v2.4.6 (activator v1.3.7) with Eclipse Mars:
So that you will not have a "can not resolve error" with your viewTopic.render(), you can add this <classpathentry kind="lib" path="target/scala-2.11/classes"/> to your .classpath or right-click on your project -> Build Path -> Configure Build Path -> Add Class Folder and make it point to target/scala-2.11/classes.
Run 'play eclipse' on the command line
In Eclipse, refresh your Project via hitting F5
Re-run the command in play console with the sources this time:
$ eclipse with-source=true
And then go to eclipse and clean your project and build all
According to jetbrains, the issue with templates is fixed. If you have play 2 generated source sources included in the IDEA project then you should exclude this folder from the project
http://www.jetbrains.com/idea/webhelp/configuring-folders-within-a-content-root.html
and do File | Invalidate caches and restart.
If you have an SBT project, open it in IDEA via File | Import Project | Sbt type project
Make sure to use the latest Scala and Play 2 plugins.
Close eclipse project
activator eclipse
activator compile
Open eclipse project
Add target/scala-[your-version-here]/classes to your build path as a class folder
The best you can do is just search the Stack Overflow as this topic was discussed really many times.
Playframework - Eclipse can't detect a new template
How to make Eclipse see the changes in Play! compiled templates?
scala code causes error in eclipse for playframework-2.0
etc, etc...
OK, I solved it.
I created a new app again
moved app dir
only then ran the command play idea
I've just installed Eclipse 4.2.0 and also imported all my old programs into it, except that when I run my programs, it pops up with a message saying:
Select what to run:
Ant Build: Launches an Ant Build with default
Ant Build...: Launches an Ant Build and allows it to be configured
This message has never appeared to me before. I wonder if it is because I imported my files incorrectly or something that I forgot to install. Please tell me how I can make it work properly again. Thanks in advance.
Ah! this is an issue I've experienced earlier. This tip solved the issue. Here's How to do it.
Make sure that you've built it. Or you can enable Project --> Build Automatically.
After the above option is set, try cleaning the workspace. Project --> Clean and clean all the projects you've imported.
Now restart eclipse and you can launch your program.
I'm struggling a bit, trying to properly setup my maven projects in an IDE.
I don't particularly care between Eclipse and IntelliJ, but it seems that IntelliJ handles much better when it comes to import my projects, so I think I will stick with this one.
I'm having other problems now when trying to run the install goal through IntelliJ.
The first error :
The svn command failed. Command output: 'svn' is not recognized as
an internal or external command, operable
program or batch file.
How do I configure IntelliJ in order to let him see svn ? This error sounds weird to me, as I have installed Subversion as my Version Control System in IntelliJ.
Also, and this is related, I have a setenv.cmd that I usually run from the commandLine before calling mvn install. It only sets some variable like :
PROJECT_HOME=d:\Project\xxx\xxx\Trunk
PROJECT_VERSION=0.4.3-SNAPSHOT
M2_HOME=d:\Java\apache-maven-2.0.11
JAVA_HOME=d:\Java\jdk1.5.0_11
PYTHON_HOME=d:\Python26
XOOOF_HOME=d:\Project\xxx\xxx\XOOOF-BIN-1.0.3
XOOOF_URL=file:///d:/Project/xxx/xxx/XOOOF-BIN-1.0.3
SVNCLIENT_HOME=d:\Java\svn-win32-1.6.3
CATALINA_HOME=d:\Java\apache-tomcat
PATH=C:\WINDOWS;C:\WINDOWS\system32
How could I improve this step, and find a way to make it work from my IDE ?
Thanks !
If you want to do maven builds in eclipse I would strongly suggest installing m2eclipse by Sonatype.
It has an excellent reference on how to use it -> http://www.sonatype.com/books/m2eclipse-book/reference/
Regarding the first error it seems to be not Idea fault. AFAIK Idea doesn't need/use external SVN binaries. What happens when you click "9: Changes" tab at the bottom in Idea? If you make your project/module as managed by SVN there should be Repository subtab.
You run Maven from Idea to perform install goal and that error seems to come from it. Do you use SCM/SVN plugin in pom.xml? If yes or you would like to have an ability to run SVN from command line add directory with svn.exe (d:\Java\svn-win32-1.6.3? d:\Java\svn-win32-1.6.3\bin?) to PATH (not only to SVNCLIENT_HOME). After that operation svn command from new "run window" should be recognized.