0

I have a question according to automate my project lifecycle. Now i do this manualy:

  1. build my project with Ant, get target jar, rename it manualy (add suffix, like version2.0-myProject.jar);
  2. connect to remote server via ssh, open FreeComander and copy jar file and INI-properties files to different folders on remote server;
  3. Remoutly run my application throws putty (exec bat file on server, which contain all cmd run command. This .bat contain plink.exe remote command to Lunux server, whoes contain instance of app).

What i want to do: i want to automation deployment procces, include build phase and app run phase, i want to do this: When buld executed, user asked for output-jar file suffux(like varian2-myapp.jar), ask user for properties file with what programm will execute later, and ask user for Allocated memory for JVM (now it is part of cmd comand in .bat file)

My app is simple, contains 15 Classes and 3 external libs. I want to make deployment easy and automate this process, i learn that Maven or Ant Build can help me. Please say, what way is more comfort for my task of using this build systems.

1 Answers1

0

With Maven you can use the Maven Release Plugin to deploy your package (which could be a zip with your jar and other dependencies for example) to a Maven repository (which you could be running in one of your server).

This page should get you started:

http://maven.apache.org/maven-release/maven-release-plugin/

With Ant, you can use Apache Ivy instead:

http://ant.apache.org/ivy/history/2.2.0/index.html

You then need a way to tell the server serving your app to pull the package and start using it (install it).
You could write a simple script that pulls the repo, which you trigger remotely, maybe using

plink -m

as you are doing now, or use one pre-built automation software, like https://puppet.com/.

Edd
  • 1,350
  • 11
  • 14
  • Ok, thank you for response! And can i use existing project that using Ant for build to do same functional, as you described? I Have not enought time to modify my Ant project to Maven project :-( – ArchieTheDeveloper Mar 20 '17 at 09:43
  • Yes sir! You can use Use Apache Ivy to replace the first bit. It works with Ant. Read: http://ant.apache.org/ivy/history/2.2.0/index.html and http://stackoverflow.com/questions/40247052/how-to-publish-custom-jars-to-local-apache-ivy-repository – Edd Mar 20 '17 at 09:52