I am wondering how I can quickly deploy the java dynamic web project that I built using eclipse on my mac to my Linode linux server? I already have a wordpress website running on the server and have also downloaded tomcat V6 and eclipse. Would I be able to manually copy the source, build and WebContent file contents? I would like to learn best practices for application deployment in the future but this project is very simple and I would like to be able to make it live as soon as possible. If you could also recommend any step by step tutorials I would really appreciate it.
thanks so much
Timnit
You should consider to build a WAR. Eclipse is just an IDE, it helps to develop, not to deploy.
Build your war (you can use maven/ant/build it from eclipse) - whatever you chose.
Once its ready your "deployment task" becomes a matter of moving a single file from MAC to linux server.
Use Cargo. See how easily it can be integrated with Maven build. Here is an excellent blog post.
Related
I'm currently experimenting with the idea of having a full cloud development environment. I decided to go with Cloud9 IDE and deploy my app on Heroku while using GitHub to store my code. As Java is my most comfortable language, I'm adopting it for my app.
Now the Heroku tutorials use Maven for Java packaging. Is there any way I can replicate this in Cloud9, or can I skip the Maven altogether? Or must I manually put in all the pom files myself?
Note: I do intend to install Toolbelt on my local machine, but there will be times when I want to do coding when I'm not at home and don't have access to the local server. I'm more interested in knowing if it is possible to not have any dependence on a local machine at all.
Not at the moment as Cloud9 lacks build tools for Java. A thing called 'private RunVMs' will be launched in the next couple of weeks that allow you to install a Java build environment from within Cloud9; then deploying to Heroku would be possible for Java apps as well. Keep an eye on the blog for updates.
edit Cloud9 now has private VMs. It should be possible to install a java runtime in Cloud9 if you are on a premium plan now.
i whant to ask, if there is simple way to start clean JSF project in Eclipse? I mean, so preoject with configuration and sample data?
I need something like Matt Raible's App Fuse, but created for Eclipse, Ivy and Jboss server
The simplest way is to
Download Glassfish 3.0.1 and install it.
Download Eclipse Java EE
In Eclipse, goto Help -> Eclipse Marketplace and install the Oracle Enterprise Pack for Eclipse
Create new web application using Glassfish as the server.
It is much easier with the Netbeans bundled with Glassfish.
You can try something like Matt Raible's App Fuse, if that's what you have in mind.
With configuration and data? No. How do you expect Eclipse or anything else to read your mind?
I started a new job recently. I've been a Java & XML web developer for two years. The new place I'm at has several large web applications, but none of them deploy to my local JBOSS server because some genius decided to create a Java Project instead of a Dynamic Web Project. I tried following the steps to convert the project but that creates a bunch of errors which I cannot resolve.
The people I work with are all consultants and never give me a straight answer on how I can develop/test my changes locally.
Has anyone had to program in a similar situation? If so... got any advice?
I've worked on projects like that, but with Tomcat as the server instead of JBoss. I develop in Eclipse using a normal Java project, and I follow these steps:
Run an Ant script to build the project into a new WAR in a temp workspace directory.
Use an Eclipse plugin to stop the local test server.
Run an Ant script to copy the WAR to the proper directory for Tomcat to pick it up and deploy it.
Use an Eclipse plugin to start the local test server.
Tomcat's fast and the project isn't huge, so this whole process takes 12-15 seconds. With JBoss being a full enterprise app server, I'd think it might take more time.
I have a question regarding the development of liferay portlets using the liferay plugin SDK. My question goes mainly in the setup of the development IDE. The suggested one would be to use Netbeans IDE which I also tried out, but it appears to run very slowly on my machine while Eclipse is quite performant.
The setup for Netbeans IDE is the following
Go to the directory \portlets
Run the create.bat (or sh file depending on the OS) to create a new sample portlet
Run Netbeans IDE, create a new "Java free form project" and point it to the directory of the created sample portlet
That's it, pretty simple.
For the mentioned reasons above (and because I'm a lot more familiar with Eclipse) I'd like to import the project into Eclipse the same way. Is there a way for doing it without having to change too much in the original structure of the created sample portlet and the according build.xml (ant file)?? I tried already to create a new project out of the build.xml ant file of the created sample portlet, however in this way it doesn't include me the source code.
I didn't also find great tutorials on the web...
Could someone help me with this, pointing out online tutorials or give me some hints.
Thanks
I know your pain. Starting to work with Liferay needs much time. I you do not want to edit the existing source, but only crate your own portlets, you can download the plugins SDK from the 'Additional Files' section on the Liferay website. This provides ant scripts, to create a simple JSR compliant portlet, and to create all necessary things, to create a sound Eclipse project, for example:
ant -Dportlet.name=<project name> -Dportlet.display.name="<portlet title>" create
Than cd into the directory of your created portlet an do:
ant setup-eclipse
After that you should be able to create a new project from the sources in that directory in Eclipse, which can then be deployed via another ant script to the running tomcat instance. If you already know somthing about portlet programming, you shoud be pretty much settled now. If not, try to find documentation about JSR portlet programming first, before looking into Liferay specifig portlet development.
Liferay has now released an official set of Eclipse plugins that support portlet development. Here is the installation guide for installing the eclipse plugins:
Liferay IDE Installation Guide
Also there is a getting started guide that shows what to do after installation to actually setting up your first portlet project.
Getting Started Tutorial
Liferay IDE uses the Plugins SDK from Liferay under the covers to do all the work. If you already have existing projects that you created with the Plugins SDK those can be imported into Liferay IDE as well.
Importing existing Projects
you can find the tutorial for deploying liferay in eclipse
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Development+Environment+(Windows)
No clue about Liferay's specifics, but in general, I'd do this:
Follow the steps 1 and 2 from your NB setup list
Create a new Dynamic web project (or a Java project if you don't need the web project's features) in Eclipse
Import the contents of sample portlet directory by doing Import -> File system in Eclipse
Adjust the project's Java source directory to point to the generated sample portlet source directory (that should now appear in your project)
Adjust classpath of the project, point it to LR lib folders, ...
If there's a generated build.xml, check if it can be used to deploy to LR, or to produce builds.
As of March 2011, there is some official Liferay support for NetBeans and as noted before, there is official support for Eclipse ( In the Marketplace). The Documentarian uses Eclipse himself, though many examples just use the Plugins-SDK with shell scripts, ant scripts and no IDE.
We are fighting with Liferay on Eclipse, Eclipse seems buggy and unpredictable, but we are also new to J2EE and Eclipse ( so discount this last comment a bit), and I have our portlet files setup in a separate area for SVN, requiring a refactor-move, refactor is definitely buggy.
You should be aware that there is a book for developers on the way from the official documentarian - we've bought the early release and found it useful. He does cover some IDE issues. See Manning press.
The Liferay sample portlets ( there are many) are not set up for Eclipse projects, and you'll have to import some java files and jump through some Eclipse hoops to get them into a running Eclipse project you can develop.
In my job we have to deploy an application on various environments. It's a standard WAR file which needs a bit of configuration, deployed on Tomcat 6.
Is there any way of creating a 'deployment package' with Tomcat so that you just extract it and it sets up Tomcat as well as your application? I'm not sure that creating a .zip file with the Tomcat folder would work! It certainly wouldn't install the service.
Suggestions welcome!
I should note that - at the moment - all apps are deployed on Windows servers.
Thanks,
Phill
We use Ant Installer to deploy our application, app server and install it as a service. We embed Java Service Wrapper in the installer to install the Windows service.
One option would be to use embedded Winstone servlet container instead of Tomcat as described here:
http://winstone.sourceforge.net/#embedding
Then you would have executable jar file running your application.
You could probably modify the installer that Tomcat itself uses.
Simply zipping up the directory is a valid solution, but as you note, it will not install the service.
I would probably (a) zip up the directory (b) use one of the open-source service registry programs to install the server and maybe (c) uses NSIS to build an installer.
Depending on the installation environment, your installer may also need to ask the user for a server port, since your application may not be able to use the default HTTP port.
It's commercial, but install4j will do this for you, including installing the service.
You could use BitRock crossplatform installer. You can take a look at BitNami for a number of Java applications like Alfresco, JRoller, and Liferay that have been packaged using BitRock. The BitNami stacks are completely free, though Bitrock itself is a commercial tool (we have free licenses for open source projects)