I am not sure if this question has been asked on ranch..it would certainly have been but i can't find a suggestion around.
I have a jar file created from a project build. i wish to move it to a Unix server (where i'll generate an ear - merging this jar into a template ear; and then deploy it to a server).
There are perhaps many ways to achieve it including use of FTP etc. but we don't have one.
please suggest if this has a programmatic solution..can i think on lines of opening a server socket and using a socket to move this file to server (i am not sure if this is sane!..or would doing this not corrupt the jar?)..
This sounds a bit implausible - there is a server, but it's not really accessible? Surely the sys admins must have a way to put files there; if it's not via FTP, then maybe SFTP or SCP?
Also, it sounds as if this is part of the build process - why do you want to do this programmatically in Java code?
Either way, I advise against home-brew solutions like the socket approach you mention. It would require an additional server to be written and maintained - much better to use an FTP server instead (even if there isn't one yet).
Ping & DNS - updated with new look and Ping home screen widget
Joined: Apr 02, 2007
Yes i am writing an auto-build process for multiple projects to use same structure.
There is one ANT based script which executes after a jar has been created. This script, as i wish, should port the jar file to the server where i've written remaining part of build - for generating EAR (this part of build depends on various factors all of which are not known to me as they keep changing), and deploying on server.
The server is accessible through SCP and yes i can place files through WinSCP and similar tools.
However, i wish to understand how, if possible or if not then other ways; can i write this piece of logic, in any manner(be it code or not), with minimal dependencies on users generating the builds.
i dot want the users to worry about availability of an FTP server on target machine..all they should bother is to trigger build and it should generate jar > send it to server > where it's bundled in an ear > and is deployed.
i understand build tools and other approaches can do it but i don't have them at my disposal. How should i approach this then?
as i said, it may not be a very sane thought
Joined: Mar 22, 2005
OK, so when you say "programmatically" you don't necessarily mean Java code - an Ant script would be OK; do I have that right? If so, that simplifies things quite a bit, because Ant does come with an SCP task built in.
Usually, it's easier to use the Ant EAR task to build EARS. There's also an Ant deploy task.
My preferred method of doing stuff like this is to have a build server set up in the production area. We check all the source code in on the development side, put in a change request, and they run the production build and deploy. And in the process, ensure that the deployed code is, in fact, the results of building the official source code.
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Apr 02, 2007
Thanks for suggestions!
i was able to solve this by using ANT tasks. used SCP task to move the jar file to server and then SSHEXEC task to execute the remote build.
thanks yet again!