Changing Deployment Directories and Package
"How do I get everything inside the Orion directory?
Ideally, for
me, everything would be located in the Orion directory. I'd
like the HTML and TAF files to be located in
Orion/default-web-app/ and the JAR file to be in
Orion/default-web-app/web-inf/lib/ (or is it classes?)
directory. I cannot seem to edit the right files to make it
happen that way.
I always end up switching everything back to the defaults of
mypackage and the source-code and jtransit/webroot/
directories to make anything work at all."
First let's address changing the "mypackage" package to something more meaningful (which should start with your domain name in reverse, for example, com.mycompany.mydepartment.myproject). You should change it in your project.xml file as well as your jtransit.xml file.
That is all that is required to change the package, but note that it is also referred to in the jtransit.bat (jtransit.sh) file as well. In this script a mypackage.jar file is created and copied to the webroot/WEB-INF/lib directory. You can change the name of the .jar file to anything you like, but make sure you still include the top-level package directory in the generated .jar file. For example, if your new package is com.mycompany, you will see a directory called "com" under the gen/classes folder after you compile. If you wanted to call the .jar file myproject.jar, you would change the jtransit.bat file to read
cd gen\classes
jar cfM myproject.jar com
move myproject.jar ..
cd ..\..
if exist webroot\WEB-INF\lib\NUL copy gen\myproject.jar webroot\WEB-INF\lib
Also remember to delete any old webroot\WEB-INF\lib\mypackage.jar file, otherwise you may get older versions of your code instead of the most recent code in the myproject.jar file loaded by the app server at runtime.
OK, now for the directories. Just remember that by doing the rest of this you run the risk of having people download your source code if you misconfigure anything, because by putting .taf files etc. under the webroot (always has been a bad architecture in my opinion) the Orion web server wants by default to serve these out as HTML pages.
* You need to change jtransit.xml default-webroot to point to default-web-app. This causes JTransit to look for @INCLUDE and .tml files under that directory instead of under source-code. The path should be relative to the orion directory, so using default-webroot="default-web-app" should work.
* To get Orion to serve the static files from that directory instead of jtransit/webroot, change the orion/config/application.xml file entry to read
<web-module id="defaultWebApp" path="../default-web-app" />
This path is relative to the orion/config directory. You might have to use Windows path separators here (\ instead of /) on Windows.
* Don't forget to copy your WEB-INF into orion/default-web-app as well. If there's already one there just delete or rename it.
* Change all your deployment .bat files to copy the build products into the correct WEB-INF/lib directory to make the compile/build/restart/test phase easier.
|