How can I setup ANT with Subversion and ColdFusion Builder (eclipse) to check out a local build to work on? - eclipse

I am not sure if there's an answer for this already -- couldn't find one for this (hopefully common) setup:
I recently converted one of my ColdFusion projects to deploy via ANT.
I have a local ant script that instructs a remote server to check out the code, and run the application's specific build file, remotely on the server.
I have a few endpoints:
Live - production (on the production server)
Staging - on the production server, different datasource, etc.
dev - on the local box.
What I have run into it seems is a simple and common problem. I now need ANT to create any build, even locally. Fine, created a local endpoint and it configures for my box.
Issue? How do I get it to show up as a project (automatically if possible) in Eclipse/ColdFusion builder. What I envision is instead of checking out a branch via the subversion plugin in CFBuilder/Eclipse, I now use ANT to do that for me.
Since I use ColdFusion Builder (Eclipse + Adobe's plugin), I have all of eclipse's tools and plugins available to solve the problem of : how can I best call ANT from within Eclipse/ColdFusion Builder, to setup the local build as a project that I can develop and work on?
I think when I check the code back in from the local box, I'd have to be sure not to check in any files with local config paths, etc.
I hope this is a detailed and clear enough explanation, if not, please ask.
Thanks in advance!

You won't be able to have it "automatically" show up in CFBuilder, but you can make it pretty easy.
Eclipse requires the ".project" file, which is a simple xml file that by default generally just contains the project name.
Once you check out your project from SVN, Do file -- new -- ColdFusion project and point it to the directory where you've checked out your code. This will create the .project in there. From there, you can commit that file to SVN.
Subsequent developers who check out the project from SVN can then do File -- Import -- Existing Project into workspace, and point it to their checked out location. Since it'll have the .project file in there (from when you committed it), that project will show up when they search for projects in that import wizard.
Now, that's how you'd do it if you already used ANT to check out the code. However, if you wanted a potentially even easier way, then you can just install either the Subversive or Subclipse plugin into CFBuilder, and then do
file -- new -- checkout project from svn
point to your svn url
select the directory you want to check out
choose a location where you want the code to live
click through to completion

Related

Does the buildpath needs to reconfigured on local machine for a project checked-out through SVN?

This is my first time using SVN or for that matter any version control. So, I've been able to check out a selenium project on my local machine. This source code was working fine on the other machine(my friend's), but on my machine it throws hundreds of errors such as "BeforeClass cannot be resolved to a type, Assert cannot be resolved to a type" etc.
I do know that this error could be because the required selenium jars may not have been setup in the build path. But, I can see all these selenium jars in the "lib" folder.
So, I want to understand if I need to reconfigure the build path. By the way, don't the project settings etc come by default as the same code works perfectly on other machine, which means the build path must have been configured there.
I know its a very basic question, but I assure you that I'm a naive coder.
Thanks for your help.
Note: I'm using Eclipse IDE
Eclipse's project configuration files (eg, .project, .classpath, .settings, etc) are designed to be checked in with the rest of the project. If done so, whenever the project is checked out to a workspace Eclipse will automatically use them to properly configure the project. Check that your friend checked in those files; if not, ask him to.
It looks like you did not add Eclipse project metadata files(.project,.classpath) & .settings folder to your source control system, so Eclipse doesn't know what your build path is or whether it is even a java project.
Go back to your other computer and look for the following files in your original project root...
.project
.classpath
.settings/*
Make sure all are present in Source Control System.

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

Remote Play framework and Eclipse

I have a play framework project which run on remote server.
I'm trying to configure eclipse to work remotely on the project.
since no build is required my requirements are to be able to edit the project files from eclipse and automatically save on server, auto complete and debug.
I've installed Remote System Explorer on eclipse and setup a remote ftp connection to my server.
The play environment on my server is under
/play-2.0.2/
My project path is
/play-2.0.2/test
In RSE I clicked on /play-2.0.2/test and 'Create Remote Project'
Now in Java perspective I can browse through the project, change files and then automatically save to server.
My problem is auto completion of play framework library doesn't work well since all the reference are to /play-2.0.2/repository/...
any idea how to solve it? I tried to play with the build path but no success
Thanks!
So, I was looking into achieving the same thing myself.
The problem you are experiencing is due to the fact that the .classpath file has absolute values. While for me, besides the symlink that doesn't work between two different kinds of O.S., I thought on another two solutions:
Use sed to rewrite the classpath on the .classpath file after it's generated
Use a "classpathTransformerFactory" for the sbt eclipse command
I haven't had to deal with it (it's more of want to than whatnot) as soon as I do, I will explore the two options and post details. I just leave the answer here in case someone wants to pick up where you left.
Another thing is:
Seen that sbt picks up the libs referenced in build.sbt, downloads the jars and puts them in the ~/.ivy2 directory, if you use any of those methods to change the reference from the remote machine to the local one, you would need to make sure that the same libs are on the local ivy cache. So, just as I wrote this, another idea came to mind:
sbt eclipse or play eclipse or activator eclipse [it should be the same] on a local environment, and on the remote one, then, transfer the .project and .classpath files from the local to the remote, and see what happens (if it doesn't work, scan them for absolute and incorrect paths that might need to be changed)
Sorry for the unproved answer, still I think it's better than no answer.
Cheers

distributing eclipse build, debug, and external tool configurations to my coworkers

I'm building some fancy build debug and external tool configs for an eclipse project so the build button will build locally, the debug button will debug remotely, and the external tool button** will deploy to a test box.
I find these really useful and would like a way to package them up and distribute them to coworkers. I dont want to push the whole project configuration on people because everyone has different project configurations.
ps: any background on how tasks are stored and how to import them would also be well appreciated.
You can mark a configuration as shared and it put it into your project as a file. You can then add that file to source control and it will appear in other developers' environments. On the Common tab, you switch from Local file to Shared file. I think this only works if you've got the .project and other configuration files under source control.
I just noticed that you're using maven, so you probably don't have the .project under source control. You may have to get each developer to manually add the launch file into their project. I don't know.

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.