Hi all,

I have committed the first cut of the MerlinComponentService [1] by Peter
Courcoux and added in a working unit test [2].  Here are my issues at this
point with understanding Merlin.

1) If you look at the unit test, I can run the HelloComponent from the Maven
tutorial fine.  In fact, by adding it to the Turbine repo, Merlin nicely
downloads and installs the jar!  Very handy.

However...  I want to master all my jar dependencies in my project.xml file.
That way, run I build the maven war task to build my WAR file to deploy, all
my dependencies are included, versus this dynamic downloading from the
block.xml files.  However, there doesn't seem to be built in any way to load
all my jars from the WEB-INF/lib directory.  The DefaultFileRepository could
be pointed at a web-inf/lib directory, but it wants to load things as
WEB-INF/lib/{groupId}/jar/{artifactId}.  However, I could replace it with
one that resolved them directly.

But, the other problem is that I can't seem to pass in my own classloader.
I do most of my development in Eclipse, and one of the things I am used to
with ECM is just including my jar in my classpath and having everything
work.  But, because Merlin is using it's own classloader, it doesn't pick up
the Eclipse classpath, therefore it has to download and install it someplace
to use it.  (I think...)

2) If you look in the MerlinCompoenentServiceTest the second unit test won't
run.  I am not sure how to load the TestComponent when it is part of the
same code.  Or, does it have to be a seperate project?  I am used to writing
components that are just part of my application classpath and source tree,
not loaded from seperate jars.

3) Integrating ECM components.  I am looking at the various changes, and to
use a component that was compatible with ECM in Merlin requires some
signficant changes.  I guess the big issue is the need for the .xinfo file.
If I have an existing jarred up ECM component that I want to use in Merlin.
Can I just write by hand the .xinfo file?  How do I get it to load?  Just
add into my /classes directory the full path to the class name and put the
.xinfo there?  So, the .class file is loaded from the jar, but the .xinfo
loads form the /classes directory?

4) Running unit tests inside of Eclipse.  I discovered one issue, which is
that the AbstractMerlinTestCase expects a System property like this in the
getBaseDirectory method.  I'm guessing because it is oriented towards Maven:

        String basedir = System.getProperty( "basedir" );

However, in Eclipse this isn't provided, therefore it fails with an NPE.
Now, I think the AbstractMerlinTestCase could do something like:
        if(basedir==null){
                basedir = new File(".").toString()
        }

   I think it is crucial to be able to run unit tests via the IDE debugger.


Overall, I can definitly see the niceness of having a single Merlin
repository on a machine for multiple applications.  However, I think for
many of the Turbine users, they are going to want to instead have all their
jars included in the war file, or at least, have the option.  I like the
repository as it'll make my WAR files much smaller and look forward to when
I can set up a single repo to load from.

Eric Pugh


[1]
http://cvs.apache.org/viewcvs/jakarta-turbine-2/src/java/org/apache/turbine/
services/avaloncomponent/TurbineMerlinComponentService.java
[2]
http://cvs.apache.org/viewcvs.cgi/jakarta-turbine-2/src/test/org/apache/turb
ine/services/avaloncomponent/MerlinComponentServiceTest.java


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to