Kunagi is a simple Java Web application for which we are already creating a binary .deb
package for our users. This package depends on tomcat6
and just puts the .war
file into /var/lib/tomcat6/webapps
. This works great on Debian and Ubuntu.
Now I want to create a real source package which can be integrated to Debian. Sadly I can not find any tutorial. There is a lot of fractioned information about tools like CDBS, DH7 or javahelper and their commands. But which one should I use?
I also have some conceptual questions:
Usualy, web applications are installed by copying the webapp into the webapps
directory of the web container. Would it then be right to make my package dependent on tomcat6
and install my webapp directly into /var/lib/tomcat6/webapps
? Or should my webapp be installed somewhere else, providing a separate Tomcat configuration and run with its own user, like other services do?
My webapp uses libraries (JARs) from other projects. Usualy these are placed in the WEB-INF/lib
subdirectory of the webapp directory. Since including libraries in a package is not allowed in Debian, would it be right to add these projects as dependencies into my package and create symlinks in my WEB-INF/lib
directory? Or how would I solve this problem?
My webapp needs to write files (application data). Since Tomcat is running as user www-data
on Debian, the only directory where my webapp can write is /var/lib/tomcat6/webapps
. Is it the right place to put my data? Or should my package create something like /var/lib/my-webapp-name/
and grant write permissions for user www-data
?
Well... If you have to create Debian package than there is a great jdeb library which works for both ant and maven. The best feature is that it does not require any dpkg
wrappers so your build will not be os-dependent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With