2 Replies Latest reply on Mar 24, 2015 12:55 PM by Garry Dias

    Backup deployments after jboss-cli DEPLOY command

    Garry Dias Newbie

      There´s a way to backup an artifact after jboss-cli DEPLOY command? And more: there´s a way to restore it if I need a rollback operation?


      For exemple:

      If I run this command against an Wildfly instance with a deployed artifact named myArtifact.jar, something like that should happen:

      ./jboss-cli.sh --connect -c "deploy --force target/myArtifact.jar"

      (Behind the scenes the deprecated myArtifact.jar should be copied to a $JBOSS_HOME/standalone/deployment-bkp directory and the new artifact is copied to $JBOSS_HOME/standalone/data/content directory)

      If the new myArtifact.jar needs a rollback, something like that should be used:

      ./jboss-cli.sh --connect -c "rollback-deployment --name=myArtifact.jar"

      (This operation should remove the JAR in content directory and redeploy the JAR in deployment-bkp directory)




      There´s a way to easily locate and backup a deployed jar before a REPLACE (via wildfly UI) or deploy --force operation?


        • 1. Re: Backup deployments after jboss-cli DEPLOY command
          Stephen Coy Master

          Many organisations use something like nexus or artifactory to store versioned copies of jar files, war files, etc in a standard way.


          Build tools like Apache Maven and Gradle store the results of their build process in repository managers such as these.


          As we always build and release versioned artifacts, we can always grab the previous version and redeploy it.


          Subsequently there is no need then for a server based backup process.

          1 of 1 people found this helpful
          • 2. Re: Backup deployments after jboss-cli DEPLOY command
            Garry Dias Newbie

            I know these two and I´m using artifactory actually.


            My real issue is that my jars can´t carry the version number in their names:


            Is a multi-module project containing 15 jars deployed in an wildfly instance and each jar has a jboss-deployment-structure.xml or jboss-all.xml declaring the dependencies between them. If I need to deploy or replace a new module I don´t need to deploy its dependencies with updated dependency declaration in jboss-deployment-structure.xml or jboss-all.xml.


            My artifactory issue is that when I perform a mvn release:perform the jar files are stored with the version number in the name.


            Maybe I should find a way do deploy to artifactory with {file_name}-{version}.jar and rename it if deploy it as a rollback.