[ 
http://issues.apache.org/jira/browse/CACTUS-211?page=comments#action_64758 ]
     
Felipe Leme commented on CACTUS-211:
------------------------------------

Vincent,

My case is hard to explain. Basically, the common project is not really a 
project, but a bunch of code that must be reused by the other projects (which 
in turn would generate jars that include the common code). I could try another 
aproach such as creating a Maven goal that merges the JAR, but then we would 
have other issues, such as how to get the XDoclet tags that are present on the 
common code.

Anyway, I started the work on the change and found an issue: originally, I 
included the following code on cactus:init:


<ant:path id="cactus.compile.src.set">
  <j:if test="${cactusSourcePresent == 'true'}">
    <ant:pathelement location="${cactus.src.dir}"/>
  </j:if>
</ant:path>

The problem with the code below is that if cactus:init is called twice, the 
pathelement will be added twice and then cactus:compile will fail with a 
"duplicate class" exception.

Unfortunately, there is no easy way to check if the pathelement is already set; 
the best solution would be a <maven:getPath> tag (similar to the existing 
<maven:addPath>), but such tag does not exist yet (I could create a patch for 
it though).

So, we have at least the following options:

1.Create the maven:addPath on maven/jelly-tags, than generate a 
snapshot/timestamp release and use it on the Cactus plugin
2.Temporarily create such tag on Cactus's code
3.Write a Jelly code that does that check
4.Use some sort of global variable that forbidden cactus:init to be executed 
more than once

Vincent, what do you think?

-- Felipe

PS: the maven-java-plugin does not suffer from this problem because the initial 
path element is created at drivers.jelly










> Support multiple source directories
> -----------------------------------
>
>          Key: CACTUS-211
>          URL: http://issues.apache.org/jira/browse/CACTUS-211
>      Project: Cactus
>         Type: Improvement
>   Components: Maven Integration
>     Versions: 1.7
>     Reporter: Felipe Leme
>     Assignee: Felipe Leme
>      Fix For: 1.8

>
> Cactus should allow tests to be defined in multiple directories. Although 
> this is against the "Maven way", tha maven-java-plugin allows that, so Cactus 
> should mimic its behaviour.
> Right now, the source is defined using the following Ant task:
>   <ant:src path="${cactus.src.dir}"/>
> While on maven-java-plugin it is slightly different:
>  <ant:src>
>    <ant:path refid="maven.compile.src.set"/>
>  </ant:src>
> I will write some test cases for this improvment and then committ the changes 
> (hopefully on time for 1.7.1).
> -- Felipe

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Reply via email to