Handling of Ant-built modules
While IDEA's j2ee build and packaging system is getting better, there is still
often a need for a custom (e.g. Ant-based) build and packaging, especially when
an application has to run on more than one app-server. However, this breaks large
parts of the app-server integrations since they can't build and deploy such modules.
What I'd like to do is to define a j2ee (app, ejb or web) module that references
the location (ear, jar, war) that is built by an Ant script and use that together
with an app-server run-config so it can be automatically or manually deployed.
The simplest thing would be to be able to exclude a module from the build process
which is needed to avoid the pre-built file being overwritten by IDEA. I can also
imagine a "Pre-built APP/EJB/WEB" module-type that only refers to a pre-built file
and does not take part in IDEAs build process. This way there wouldn't be any unused
content-roots, descriptors, etc. As a bonus it would be great to define an Ant-target
to be executed when Make is invoked on the module.
Does this make sense or is there a better way to deal with such applications/modules?
Sascha
Please sign in to leave a comment.
+10
Sascha Weinreuter wrote:
--
"A man's ethical behavior should be based effectually on sympathy,
education, and social ties and needs; no religious basis is necessary.
Man would indeed be in a poor way if he had to be restrained by fear of
punishment and hope of reward after death."
[Albert Einstein, "Religion and Science", New York Times Magazine, 9
November 1930]
In article <cudbj3$99t$2@is.intellij.net>,
Sascha Weinreuter <sascha.weinreuter@NOSPAM-cit.de> wrote:
If I understand what you're saying, I have to do the same here. First
you can turn on both exploded and generate jar dir. When you run the
generate ant script (and there are many quirks to this generator for
which I filed many bugs being looked at) it will generate the building
of the war file. What I would like is a way to setup a difference
between this 'test' war which is what is used all the time, and a way to
generate automatically a 'production' war which would contain all the
files in test, but with differences of those that are needed for a
production war file. For example differences could be different web.xml
which has different servlet context values, or a different OJB or
hibernate deployment config descriptors etc... Of course this applies
to doing that with app server specific descriptors as well.
Maybe something called a deployer module which would be based on a web
module, but then allow configuration of different deployment
possibilities in one deployer module. These modules would not be ones
we'd edit code from or anything like that, rather modules which can be
linked to the web module and setting off a menu function called build
deployment files would build them all.
Once we do that, generate ant script should also generate the tasks
those deployer modules.
R
I'm not sure if I can follow... :?
The problem is that the IDEA build cannot handle some things like
XDoclet generation and it doesn't really know how to package an
application for different app-servers. Imagine an application that
has been built by a totally IDEA-unrelated Ant script. I'd like to
use this application together with the app-server integrations that
allow me to start the server and deploy (undeploy) the archive to the
proper place with one click inside the IDE.
In short, I need a module that is not built or managed by IDEA but which
can be deployed to an app server and which may have a custom build-logic
attached via an Ant target.
Sascha
Actually, I believe you can do what you're asking in a kind of
convoluted way. Just create a "dummy" J2EE module for each of your
appservers and under J2EE build settings select "Create application
archive file" and point it to your ear. Then add a "Run configuration"
for each app server and "point" it to the J2EE application that you want
deployed to that server but make sure the "Make module..." selection is
unselected.
Sascha Weinreuter wrote:
--
"A man's ethical behavior should be based effectually on sympathy,
education, and social ties and needs; no religious basis is necessary.
Man would indeed be in a poor way if he had to be restrained by fear of
punishment and hope of reward after death."
[Albert Einstein, "Religion and Science", New York Times Magazine, 9
November 1930]
Brad wrote:
That's what I also thought of, but I have about 20 other run configurations
that I absolutely want to have the "Make module..." switch turned on and I
don't feel like changing that switch every time. I personally think this
should be a per run-config option.
The other problem is that the deploy action in the run-window does not honor
this setting, so it's not possible to re-deploy anything without a server-restart.
Sascha
In article <cudgnb$orm$1@is.intellij.net>,
Sascha Weinreuter <sascha.weinreuter@NOSPAM-cit.de> wrote:
Did you try right clicking on the ant target and choosing run
before/after?
R
Robert S. Sfeir wrote:
Yep, but it also doesn't solve the redeployment problem :(
Sascha
In article <cudmgi$7ga$1@is.intellij.net>,
Sascha Weinreuter <sascha.weinreuter@NOSPAM-cit.de> wrote:
yup true
R