Destination for AntCompiler
Brought to you by:
mecki
I've attempted to use the new AntCompilerAdapter to
compile JSPs under Jasper/Tomcat. It seems to work,
with one problem: Jasper and the servlet container want
the .class file to be in the same directory as the .java
file. Janino is putting it elsewhere -- I'm guessing it's
going under "user.dir". The path looks like this:
myappdir/null/org/apache/jsp/my_jsp_page.class
Jasper violates the rule that says that java and class
files that use a package must be in a directory structure
that matches the package. Instead, it just puts things in
a "work" dir.
The AntCompilerAdapter may have to examine a few
more of the configuration parameters that it is currently
ignoring.
Logged In: YES
user_id=865893
To be honest... I'm not the ANT type of guy, and I also have
no TOMCAT configuration running on my home PC.
The AntCompilerAdapter writes its class files to the
directory given by
DefaultCompilerAdapter.destDir
(or the current directory if "null"). It is very difficult
for me to figure out which configuration parameters the
AntCompilerAdapter should honor and how. Can you create a
short spec for that, and I would implement it? Or you would
fix AntCompilerAdapter yourself? It's only 50 lines of code...
Logged In: YES
user_id=865893
The AntCompilerAdapter was largely improved in 1.0.13. Can
you please try again with this new version?
Logged In: YES
user_id=68865
Nope, doesn't work. Same problem: it's not putting the
generated class files in the same directory as the Java
source. I have no idea where it's actually putting them.
You can't use classFiles[j].storeInOutputDirectory
(this.outputDirectory) because that method creates a
directory structure that matches the packages.
Logged In: YES
user_id=865893
Could you please set "DEBUG = true" in "Compiler.java" and
send me the output?
Logged In: YES
user_id=865893
I'm getting closer... it's not an ANT feature, but a JAVAC
feature: If no destination directory is specified ("-d"), then
JAVAC stores the class file in the same directory as the
source file, regardless of the name of that directory. I will fix
JANINO to mimic this behavior.
Logged In: YES
user_id=865893
Release in 1.0.17.