Attempting Ant build with Weblogic 10.3 Dependency
I'm a CM and am responsible for our Continuous build process, and helping the developers define and use the builds correctly. I try to set things up in such a way that the developer merely has to download the module from the Source control system, and type in ant
or maven
and have everything just work.
In Ant projects, I either use ivy
or have a lib
directory that contains the required third party jar files. This helps me to clearly define all the dependencies and makes it easy for the developers to get the module to build on their system. Yes, there is some dependency on the right JDK version, and somewhat on the right Ant version, but even these are a bit flexible. Besides Ecipse and Jenkins/Hudson allow you to define the exact JDK and Ant versions you want to use.
The problem is this one project that's dependent upon Weblogic 10.3 (aka 11g). Before Weblogic 10, you could pretty much get away with using just the weblogic.jar file and maybe one or two other jars. Starting with Weblogic 10, the jars are now "modularized".
When I do a build, I still simply include weblogic.jar
in my classpath. However, weblogic.jar
, in its MANIFEST.MF
file contains references to the ..\..\..\modules\features
directory (which is actually the parent directory that contains Weblogic 10.3!). In here are jars that contain no classpaths, but themselves have a Classpath embedded in their MANIFEST.MF
that points to other jars. These in turn can refer to other jars.
I figure I have one of these choices:
- Include the entire 10,900 file, 700Mb Weblogic in my source repository for each module.
- Somehow download Weblogic using either Maven or Ivy as a single tarball. Untar the file, then do my build.
- Tell the developers that they must download Weblogic 10.3 and then modify the build process to point to where they installed Weblogic 10.3.
None of these options really appeal to me right now.
UPDATE
As others pointed out, I could try to find the various jars, and I did exactly that with Weblogic 9.x and earlier versions. For example, a simple shell script:
find $WEBLOGIC_HOME -name "*.jar" | while read jar
do
echo "JAR NAME = jar"
jar tvf $jar
done | less
would display the content of all Weblogic JARs on my terminal. If I find in a build that javax.servlet.ServletException
class is missing, I could search for javax\servlet\ServletException.class
, then go back up searching for the JAR NAME =
and find the name of the jar.
However, in Weblogic 10, I found that I depended upon javax.servlet.ServletException
, and traced it back to the C:\bea\modules\javax.servlet_1.0.0.0.0.jar
which isn't even in my $WEBLOGIC_HOME
directory. This is because C:\bea\wlserver_10.3\server\lib\weblogic.jar
contains a classpath to ..\..\..\modules\features\somejar.jar
. And somejar.jar
doesn't contain any classes. Instead it contains a reference to another jar in its classpath, which then refers to the javax.servlet_1.0.0.0.0.jar
.
So, I now have to add in four more jars, one of which contains no classes, and if I want to emulate the structure of Weblogic, I have to have the following files in my lib
directory:
weblogic.lib\wlserver_10.3\server\lib\weblogic.jar
weblogic.lib\modules\features\somejar.jar
weblogic.li开发者_StackOverflowb\modules\someOtherJar.jar
weblogic.lib\modules\javax.servlet_1.0.0.0.0.jar
Okay, that only took about 2 hours to resolve. One dependency issue down, 43 more to go.
As you can see, this may take days, even weeks to complete, and end up with dozens of jars in my ...uh... minimal Weblogic 10 module. In the end, this minimal module may not be all that much smaller.
Does anyone know of maybe some documentation that allows me to quickly determine where these dependencies exist, or a way of building a dependency tree, so that when I need the classpath com.bea.weblogic.foo.bar.barfoo, I can quickly see that I need these 7 or 8 jars?
I suppose you won't need the whole 700MB package to build. So you could (yes, that's some work to do) build your own "weblogic-ivy" file, that describes the mininmal jar-set for build and test. Publish that file to your company repo and use it in your dependency conf and you and your developers can just work with the minimal conf which shouldn't be much larger than other app-server-client packages.
I gave up. I simply installed Weblogic 10 and checked in my build.xml
that $WEBLOGIC_HOME
is set.
精彩评论