1 Reply Latest reply on Dec 9, 2006 6:11 PM by peterj

    Exploded archives vs packages

      What's the difference between putting the same archive in exploded form versus packaged form in a deploy directory? What are the advantages and disadvantages? (I imagine it's more than a simple choice of personal preference, though it may be...)

      Also, is the only requirement (apart from having the appropriate files within the exploded archive) for an exploded archive to have the appropriate suffix on the folder name for it to be automatically deployed? (e.g. explodedfolder.ear, explodedfolder.war, explodedfolder.sar) That's it?

      Though I bet it would cause a lot of conflict when you accidentally have a folder and file of the same name...does JBoss have preferences in terms of which it loads first, or is this configurable, or will it cause trouble that'd be hard to detect until you realize your mistake?

      Thanks.

        • 1. Re: Exploded archives vs packages
          peterj

          Advantages of deploying a packaged file: everything is in a single file; you can deploy using jmx-console (or twiddle).

          Advantages of deploying an exploded directory: you can easily change/add various files (such as JSPs, CSS, HTML) and have them picked up automatically without redeploying the application (note that this does not work with class files); JBoss does not have to unpack the files into the tmp directory.

          Yes, the exploded directory must have the same suffix as the packaged file. The main deployer user uses suffix to determine what kind of directory it is and then invokes the correct deployer (actually, it asks each deployer is it recognizes the file, and the first that say 'yes' gets to deploy it). Other than that, the contexts are the same as if you had unzipped the packaged file.

          Yes, if you have to be careful if you switch between exploded and packaged, because a simple copy/overwrite will not work. In my Ant script, I typically attempt to delete both the file and directory before copying over whatever it is I am deploying. Unless I am always doing exploded, in which case Ant's copy task copies only the updated files.