A way to work on the same project on Eclipse over a several machines? - eclipse

I'm a computer science student, and I'm taking Java2EE Development course.
a bit information about my purpose:
I've got a final project to submission.
In general, I need to develop a JavaEE servlet to manage a book library (server side),
so I also need to use a Database (I've chosen MySQL), and I have to work with Hibernate framework.
It's a bit large project considering the submission date (end of semester, about 4 weeks to work) and considering the fact I have 4 another heavy courses.
Personally, I'm using Linux Fedora 19 on my laptop, and Microsoft Windows 7 on my desktop, which makes the business more complicated (Different path strings, for example).
I thought about creating a workspace on my Dropbox folder and link Eclipse on both machines to this path,
but then eclipse writes the configuration file into the Dropbox workspace,
Which forces both desktop and laptop eclipse use the same configuration, which make problems.
For example, the MySQL JDBC driver jar file in my desktop located in "C:\Users\Billie\Downloads" folder,
While the MySQL JDBC driver jar file in my laptop location in "/home/Billie/Downloads".
Eclipse writes the the configuration file of the last used machine and it's makes problem in the other machine.
Any solutions? How can I use the same JAVA2EE Eclipse project over servral machines?
Thanks in advance!

Keep sources in VCS (like Git) and use some common build tool for managing project dependencies (Maven, Gradle, etc). Don't keep configuration in VCS - just import Maven/Gradle project into IDE. Maintaining configuration in VCS is the PITA :) .

Related

Coldfusion deployment process

I am trying to figure out what's the best process to implement for build & deployment for coldfusion project.
I am much more familiar with the regular java stack: some back-end framework (Spring, Struts, etc), bunch of JSP files, then use maven to compile and bundle everything to a .war file that I simply deploy (copy) over to a tomcat webapp directory
Are cfm files practically same as jsp? What are the similarities & differences between Java vs Coldfusion build/deploy process?
The resources I found so far make it sound like to just copy & paste the physical files, which doesn't sound quite right.
The thread here Best Practices for Code/Web Application Deployment? - goes on the generic deployment process, which we already have implemented. We have code repository and maven to manage our build & deployment process, can coldfusion work straight out of the box with the same set up as regular Java/war projects?
A thread in Adobe forum does not give much insights either: Deploying ColdFusion 8 project via EAR/WAR file, plus it talks about EAR rather than WAR.
This is an old link from 2007: build tools: maven and coldfusion seem to indicate maven is not straight out of the box solution, also seems like Coldfusion has no need for dependency management that maven is so useful for?
Can someone help point me to the right direction for build & deployment of coldfusion projects with the following stack:
Code repository, doesn't matter much: Git, svn
Maven build
Deploy project as war into Tomcat7 (not built in)
MySQL db connector
and Lastly - how would the solution be different between CF8 vs CF10? Looks to me CF8 may be worse as it doesn't officially support Tomcat, whereas CF10 runs on modified version of Tomcat?
Thanks!
When it comes to deploying CFML out the box then you really just have to copy and paste the file into your web server. In your case if you are using git just pull it from your repository. You don't have to do anything other then that. However, in some cases you may need to clear your CFML Cache if you don't see the changes immediately. This is my personal process:
Make changes on local machine running a CFML Development environment.
Commit and Push changes to git repository.
Pull changes to Production Server
Clear cache if needed.
It really is simple as that as long as your code makes it that simple.
Answer 1:
I have worked on some substantial apps were the process was zip up all the files, send them to a deployment team and they will unzip at the appropriate location.
Answer 2:
I suspect you are looking for something like CAR files. http://help.adobe.com/en_US/ColdFusion/10.0/Admin/WSc3ff6d0ea77859461172e0811cbf364104-7fd3.html

Synchronize eclipse projects with my computers

Hi and thank you for reading this!
I have two computers in my office LAN: One very powerful PC which i use most of the time for development and a notebook.
Now i would like to share all eclipse projects between these two devices (for example manually sync and then switch to the notebook). I don't need them to be availalbe in a cloud or something. I have also a NAS (network attached storage) which is always running.
Is it possible to synchronize all my projects? The main problem: complexity...
I use multible eclipse installations with multible addons like Aptana
Studio, SpringSource Tool Suite, Maven, Git, ...
Most Projects are Java EE, built with maven (different maven goals like jetty or tomcat)
Some projects use git for teamwork (with some external partners)
Some Projects use my own project-builders (external programs)
I use multible workspaces (i use different workspaces for different customers which include different projects)
Some projects are inside an eclipse workspace and some are outside
My current solution is to use a file syncronization program which syncs my whole "Projects" Folder (the root for my whole working-life) to a folder inside my NAS (manual sync - not on file change or schedule). The problem with this approach: I have to synch over 100000 files. This takes 20 minutes only to analyze what has changed. And when i open eclipse one time and manipulate one static html file, eclipse changes over 2000 files (most of them are in the .metadata folder)...
I'm open to every solution. Do i have to change the structure of my project setups? Do i have to use another sync solution? Or is it just not possible? Do i have to use an cloud store solution? Would this affect projects which already use git?
Thank you for ANY reply!!!!!
best regards!
Manuel
Indeed it is possible. How about using git for this scenario? You could create a bare repository on the NAS for those projects that shouldn't be published.
I guess if you deal with source code and really a lot of files this might be the best strategy to do this efficiently and secure (in terms of get-out-what-you-put-in).
I've decided to use the FreeFileSync tool from http://sourceforge.net/projects/freefilesync/
There is some effort to configure it to ignore some files and folders, but the tool provides nice filter possibilities. Configuring these filters can be very time consuming but they're working fine :)
Thank's for all your help!

Controlling catalina_home in liferay eclipse tomcat

I have a development system ( linux-Liferay6-tomcat6-Eclipse Helios) that I have version-controlled in SVN. When I roll it out for a new developer in what amounts to a fresh installation, the paths for the tomcat server are wrong because they were written in various places as absolute paths reflecting my desktop.
It looks to me that I could modify catalina.sh or startup.sh to fix this problem, or part of it maybe, but I'd rather have a fix that leaves Tomcat unmolested. I could also require developers to set CATALINA_HOME, but that would break any other tomcat installations they might have ( my own situation in fact).
For instance, maybe a custom Ant script that figures out the path and sets CATALINA_HOME just for the shell thats running this particular Tomcat? Is there a way to do this in the Eclipse IDE, I looked but don't quite see it?
Ideas?
John Fisher
If you're using ant and the liferay plugins sdk, you're supposed to create a build.${username}.properties file in the root folder of the plugins sdk. (substitute ${username} with the name you log in to your OS). In this you override the location of your appserver, e.g. tomcat. Take a look at build.properties. Though you're not supposed to change this file, you can copy the one interesting line (note: it's preconfigured for tomcat) and use it for the appropriate settings.
This way you'll have a per-user setting for the required value.
The server (if you require to start it in eclipse) is to be created in each eclipse instance, independent of each other. The Liferay IDE plugins for eclipse can help you with setting this up.
As I expect the server to be modified by everybody on a frequent basis, I never share the server "project" in version control, but keep it strictly local. It's easily recreated if lost.

What is a reasonable way to convert a complicated Ant script to a set of Eclipse projects?

I inherited an existing Ant build script. It invokes javac three times on three different source directories: shared, client, and server. It then produces two JAR files: client.jar (shared + client) and server.jar (shared + server).
When I translated this to Eclipse, I ended up making three projects with appropriate dependencies. This works, but I'm not a fan of the Eclipse project explosion (this was an easy case; I have about a dozen such ant scripts, and some would turn into 6 or 7 Eclipse projects).
My question: is there a better way?
I should also mention that I don't want to simply create one Eclipse project with three source directories. That's not the way that Ant compiles the code, and it would make it harder to find cases where people were using classes from an inaccessible source tree (using server classes from the client code). (I also happen to have classes with the same name in client and server, so I actually can't just dump all the source together.)
We have a similar project set up: 13 eclipse projects each with their own ant scripts. 7 of them are shared and produce JARs the other 6 are webapps that get packaged in to WARs. The ant script for each of the WAR-producing projects invokes the build in its dependencies and sucks the generated jars in to the lib. So, no, we don't have a better way, but I have a fuzzy vision for how things could be better if we switched from ant to maven:
The 7 shared projects change much less frequently than the webapps. I would like to publish those shared project JARs to our own repo and then for each of the webapps specify which version of the dependency they need and let maven handle getting it for us. That way we wouldn't need to have all of the JAR projects open in Eclipse unless we were making changes to them.

Good Ways to Use Source Control and an IDE for Plugin Code?

What are good ways of dealing with the issues surrounding plugin code that interacts with outside system?
To give a concrete and representative example, suppose I would like to use Subversion and Eclipse to develop plugins for WordPress. The main code body of WordPress is installed on the webserver, and the plugin code needs to be available in a subdirectory of that server.
I could see how you could simply checkout a copy of your code directly under the web directory on a development machine, but how would you also then integrate this with the IDE?
I am making the assumption here that all the code for the plugin is located under a single directory.
Do most people just add the plugin as a project in an IDE and then place the working folder for the project wherever the 'main' software system wants it to be? Or do people use some kind of symlinks to their home directory?
Short answer - I do have my development and production servers check out the appropriate directories directly from SVN.
For your example:
Develop on the IDE as you would normally, then, when you're ready to test, check in to your local repository. Your development webserver can then have that directory checked out and you can easily test.
Once you're ready for production, merge the change into the production branch, and do an svn update on the production webserver.
Where I work some folks like to use the FileSync Plugin for Eclipse for this purpose, though I have seen some oddities with that plugin where files in the target directory occasionally go missing. The whole structure is:
Ant task to create target directory at desired location (via copy commands, mostly)
FileSync Plugin configured to keep files in sync between development location and target location as you code (sync the Eclipse output folder to a location in the Web server's classpath, etc.)
Of course, symlinks may work better on systems that have good support for symlinks :-)
To me, adding a symlink pointing to your development folder seems like a tidy solution to the problem.
If the main project is on a different machine/webserver, you could use something like sshfs to mount your development directory into the right place on the webserver.