How to speed up the deployment to a local glassfish instance? - deployment

It is very cumbersome to restart the (local running) application server manually every time I want to redeploy an application. Manually copying the EAR to the autodeploy folder works (most of the time), but I still have to navigate to the EAR, copy it, navigate to the autodeploy folder and post there.
Is there a nice way to improve on this?

I've created a context menu for *.war and *.ear files. It copies them to autodeploy. Save this to a *.reg file and activate the menu via double click on the file.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.war]
#="war_auto_file"
[HKEY_CLASSES_ROOT\.ear]
#="war_auto_file"
[HKEY_CLASSES_ROOT\war_auto_file\shell\deploy2GF\command]
#="cmd /c \"copy \"%1\" C:\\gf_domain\\autodeploy ""

Related

Eclipse workspace corrupted after saving as zip

I have a need to share an eclipse workspace as a zip file. However, when I zip the workspace and then unzip it all of the user configuration is lost including the project that was opened in the workspace, what views are showing, and even a JBoss server that was created.
If I copy and paste the workspace everything works fine.
If I zip and unzip all of the configuration is lost (i.e. when I launch Eclipse and use the unzipped workspace Eclipse opens with all of the default settings including the welcome page).
What could be causing this and how do I get the zip to work?
I know there are other ways to export Eclipse configurations but I do have a specific requirement that this be provided as a zip file.
It looks like the problem was with the file names that started with ".". I re-zipped with WinZip instead of the built-in windows tool and everything is working now. See: blog.robertelder.org/zipping-corrupts-eclipse-workspace

Eclipse with Tomcat does not automatically republish my WAR file

I've got Windows 8.1 with a 1.6 JDK manually installed.
I'm using Eclipse (Kepler, Java EE IDE for Web Developers).
I imported a project that builds a WAR file using an Ant build script; that shows up as a Project.
I created a Tomcat6 Server (downloading the available Eclipse package); that shows up as a second Project.
On the Modules tab for the Server, I clicked "Add External Web Module...", browsed to the folder holding my WAR file and clicked OK. I then added the name of my WAR file (directory name "...\SpiffyApp" to file name "...\SpiffyApp\spiffyapp.war"). I confirmed that the name of the path is "/"; I clicked to have "Auto reloading enabled" checked, and clicked OK.
I admit - I peeked inside the Server configuration. I clicked on "Open launch configuration"; in dialog "Edit launch configuration properties", on the Arguments tab, I discovered the following property setting:
-Dcatalina.base= "....metadata.plugins\org.eclipse.wst.server.core\tmp0"
Then in my mischief I observed that the "tmp0" directory had a "webapps" subdirectory. Aha!
I notice that, under some circumstances, the "SpiffyApp" is republished under "webapps" - problem is, I can't figure out when!
Specifically, I'm disappointed that Eclipse doesn't republish my app to "webapps" when I tell the server to "Clean"/"Publish". What I'd really like is for it to republish automatically when I rebuild the WAR.
I can get the WAR redeployed when I do all of this:
stopped my Tomcat Server
delete all folders under "tmp0/webapps"
delete all folders under "tmp0/work" (tip I got from Chris Lercher, here)
rebuilt my WAR file
Started my Server
Surely I'm doing something wrong.
What are the rules here? Am I really left to remove the Web Module, delete the folder in "tmp0" and re-add the Web Module?
What you're doing wrong is expecting it to watch for changes on an archive file, which generally isn't expected to change. Import the WAR as a project and then Eclipse can deploy it properly when something actually changes within the app.
Otherwise you might try forcibly Cleaning the server area from the context menu of the Tomcat server instance in the Servers View.

Eclipse project backup

I'm using Eclipse Java EE IDE for Web Developers and want something like that:
Eclipse should add current project (or open projects) to archive and copy the archive to specified folder on its (Eclipse) exit.
Is it possible with Eclipse built-in functionality - scripting, or plugin?
I don't want to use bat-files, Script Host or other external tools.
The global idea is to realize on-exit backup of my project between home and workplace using Dropbox, e.g. automated sending project backup to dropbox folder.
But current task is to realize local backup.
Why not keep your Project folder in Dropbox itself?

How do I configure the server deploy directory in eclipse?

I have 2 workspaces. I can't configure the server deploy directory in the 2nd workspace.
Eclipse indigo. JBoss server 5.x.
The deploy directory is D:\Development2\projects2.metadata.plugins\org.jboss.ide.eclipse.as.core\JBoss_EAP_5.x_Runtime_Server1324558380698\deploy
I want it to be D:\Development\jboss-eap-5.1\jboss-as\server\default\deploy as it is for the server in the 1st workspace.
I have tried every preference and property related to this server, and I can't change it. I'm all for editing an .xml file, I just can't find the one that has this information.
Any ideas?
When you doubleclick the server name, the window that opens has TWO TABS. Look at THE BOTTOM OF THE WINDOW. This information is changed in that window.
Sorry for the noise. Hope this helps someone as dense as I am.
I got this option in readonly mode.
So before making any change you have to undeploy/remove deployebles from jboss and then you can modify deployment directory operation

Eclipse publishing to Tomcat

I recently came back to using Eclipse after 2 years of IntelliJ. Things have changed.
Now when I try to run Tomcat, it tries to publish my project to it. What the hell is publish?
What ever happened to pushing a war into the webapps directory and letting Tomcat deploy it?
Right now my deployment is broken because of compilation errors. I have a feeling that Eclipse is taking my project and copying it to webapps dir without first building it properly.
Can someone explain to me what exactly publishing does, and also how to turn it off and use Tomcat like normal people?
A the "Servers" view, you can double click on your Tomcat instance, to open the server settings editor.
There, at the upper right corner, you can find the Publishing options. Check the "Never publish automatically" option, and save.
With this it should be enough.
Oh, and by "Publishing", they kind of mean "Deploying", or "Copying to the deploy directory", depending on what server you are using.
Eclipse (Helios) makes a copy of your entire Tomcat configuration and starts a new instance of the Tomcat server when you are running the web application from Eclipse. That is why you must shut down any existing Tomcat service before running in Eclipse.
The application runs out of your workspace, not out of the "webapps" folder. Eclipse modifies the copied server.xml file to add "CONTEXT" tags that include your workspace project folders in the running application list.
The path in the "CONTEXT" tag should be the name of your project folder.
You can export the project to a WAR file and deploy your web application to the webapps folder if you want.