Hi,
I've just made an initial experiment PR to use Maven instead:
- https://github.com/apache/incubator-freemarker/pull/8
Build works well mostly and seems to create an artifact properly
(target/freemarker-2.3.24-SNAPSHOT.jar).
However, as described in the PR, there are some issues and things to note:
- Two unit tests fail: RealServletContainertTest#basicTrivial() and
RealServletContainertTest#basicELFunctions().
This seems related to war initialization issue. For example, the
existing ant build copies all the necessary jar files into WEB-INF/lib
somehow, but the new maven doesn't have that.
- To support incompatible multiple versions of jython, I decided to
use the latest version of jython only and use Reflection APIs for the
older versions of jython in two classes because those two classes are
very small/simple and seems more effective using Reflection APIs.
- Similarly, I simply added a new jsp-api 2.1 operation in a base
class to support both 2.0 and 2.1 at runtime. I think this approach
should be simpler than complex dependency management and multiple
compilations.
Regarding RealServletContainertTest and testing with embedded jetty
server, one of natural solutions in Maven is to organize the project
into multiple modules.
For example, maybe we can change the project structure into this:
- freemarker
|- core
`- test
`- web
If test/web is a 'war' package project, then we don't have to copy
jars into WEB-INF/lib manually, but we can probably take advantage of
the existing features of jetty plugin or other (e.g, cargo) for
packaging in (integration)test phase, for instance.
Also, the Reflection API usages for those two test classes seem okay
enough to me, but if there's any strong reason to validate those as
early as possible, then maybe we can add more submodules for each
specific purpose.
Anyway, I'd like to share my initial experiment with you folks and
hear from you about approaches.
If we need to restructure the modules, then it should be better to get
a consensus in prior anyway.
Kind regards,
Woonsan
---------- Forwarded message ----------
From: Daniel Dekany <[email protected]>
Date: Sat, Oct 31, 2015 at 1:02 AM
Subject: Re: Question on unit testing
To: Woonsan Ko <[email protected]>
It would be in fact very good news if this thing can go with Maven...
looking forward for the results!
Thursday, October 29, 2015, 10:54:50 AM, Woonsan Ko wrote:
>>> By the way, IIRC, you mentioned in old ML that it's planned to migrate
>>> to Maven some day. Is it right? If so, when do you want to do that?
>>
>> I'm not sure if that would work out well, given that FM needs to be
>> compiled against multiple versions of the same library (including
>> rt.jar). But if someone works this topic out, it might turns out that
>> it's feasible after all. I don't know. But the bet is on Gradle. And
>> that will probably only happen when someone other than me takes that
>> task.
>
> I think it should be possible with Maven (e.g, by using multiple
> activatable profiles and system dependencies). I'd like to experiment
> it in a branch. Will let you know if I make some progress. :-)
>
> Cheers,
>
> Woonsan
>
--
Thanks,
Daniel Dekany