The following comment has been added to this issue:

     Author: Carlos Sanchez
    Created: Mon, 6 Dec 2004 12:26 PM
       Body:
If you could provide a patch in unified diff format it would be faster to fix.
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPASPECTJ-14?page=comments#action_27549

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPASPECTJ-14

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPASPECTJ-14
    Summary: Unable to weave only sources defined in argument files. Error 
during compilation if argument file contains file from sourceDirectory.
       Type: Bug

     Status: Unassigned
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-aspectj-plugin
   Versions:
             3.2

   Assignee: 
   Reporter: Alexey Dashkevich

    Created: Tue, 30 Nov 2004 1:45 PM
    Updated: Mon, 6 Dec 2004 12:26 PM

Description:
Some days ago I have started to use aspectj plugin for compilation
aspects. I use aspects only for tests. I have following structure in
project:
-src
  |
  aspectj - aspect sources
  |
  java - application sources
  |
  test - test sources

I have an "lst" file where defined what files should be compiled with
aspects e.g.:
com/toplinkmapping/UserRoleAspect.java
../java/com/toplinkmapping/UserRole.java

I want compile only files that defined in "lst" file and place classes
into test-classes folder. In project.properties I have defined
following properties:
maven.aspectj.source=1.4
maven.aspectj.argfiles=src/aspectj/aspects.lst

But when I have executed aspectj:compile I have error because this
task try to compile files from aspects.lst file and then from src/java
folder. And error occur because in aspects.lst defined files from java source
folder.

I have resolved this problem in my maven.xml by following way:
  <postGoal name="test:compile">
    <ant:path id="build.dest" location="${maven.build.dest}"/>
    <maven:addPath id="maven.dependency.classpath" refid="build.dest"/>

    <ant:path id="maven.compile.src.set"/>

    <attainGoal name="aspectj:compile"/>

  </postGoal>

So as you can see I have overwrite "maven.compile.src.set" path that
not so good.

I think it will be good if will be introduced new property
like "maven.aspectj.src.argfilesOnly" that if true then only sources that 
defined in argument files will be weaved. And following changes in plugin 
script are needed e.g.:
from
        <ant:sourceroots>
            <ant:path refid="${sourcePathRefid}"/>
            <j:if test="${aspectSourcesPresent and weaveAspectSources}">
              <ant:pathelement location="${pom.build.aspectSourceDirectory}"/>
            </j:if>
        </ant:sourceroots>
to
        <ant:sourceroots>
          <j:if test="${context.getVariable('maven.aspectj.src.argfilesOnly') 
!= 'true'}">
            <ant:path refid="${sourcePathRefid}"/>
          </j:if>
          <j:if test="${aspectSourcesPresent and weaveAspectSources}">
            <ant:pathelement location="${pom.build.aspectSourceDirectory}"/>
          </j:if>
        </ant:sourceroots>

I have attached patch and test case for it. Please, take a look at them.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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

Reply via email to