Red Hat Bugzilla – Bug 111110
ant clean should delete config registry files
Last modified: 2007-04-18 12:59:50 EDT
Description of problem:
When doing an 'ant clean', only the webapp is removed. The config
propoerty files are left untouched in $CCM_WEB_HOME/conf. So the next
time you run 'ccm load' having just done a 'dropdb, createdb, ant
clean, ant deploy' sequence it complains that the packages are already
loaded. To sort this, you need to remove (at minimum)
registry.properties & preferrably all the per-package config property
files. Care must be taken, however, not to delete servlet stuff like
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Deploy & load a server
2. Run 'ant clean' and 'ant deploy'
3. Run ccm load
Complains about conflicting packages
Loads the system.
This functionality doesn't sound like it belongs in ant clean to me.
The primary thing I use ant clean; ant deploy for (and I would submit
this is its primary purpose as well) is to rebuild the java code from
scratch after making changes that might impact APIs, changes that the
compiler won't catch from an incremental build. I often do this
without reloading the db. If this change were to be made then my usage
of ant clean deploy would end up breaking my installation by
unnecessarily blowing away my config directory.
I would submit that the ant targets (build, deploy, clean) are
currently only for compiling code and copying class files, and to
extend them into the realm of managing ccm instance data would be
making them do something that the ccm tool probably should do.
This division of responsibilities makes sense from the "deployment and
development" environments should be the same perspective since
building code and moving around class files is the one thing that is
guaranteed to be unique to the development environment, whereas
clearing the config data is probably something we want to be able to
do in a deployment environment as well.
What you probably want to be doing here is after you clear the db just
run ccm load --schema --data. That will tell the ccm tool to reload
the data model and data loading scripts.
There are obviously occasions when we need to reload the db & clean
out all existing config packages to ensure consistency with changes to
the PDL / Java code. If this isn't appropriate for the ant clean
command, then it looks like we need a 'ccm un-hostinit' (with a better
name than that!) to do these tasks. Dropping the data model has become
much more tiresome now that the drop-all.sql is hidden away inside a
JAR file rather than just in the webapp & since we're not creating the
config registry by hand anymore it'll be non-obvious to developers
just where the files to delete are.
Regardless of the path taken to resolve this ticket, it would seem
like a good idea to separate deletable files such as
from files that should not be casually deleted.
Can we put all deletable files into a single subdirectory