Discussion:
[aspectj-maven-plugin] Excluding aspect from an AspectLibrary?
nodje
2011-03-18 09:44:03 UTC
Permalink
Hi,

I'm using aspectj-maven-plugin with spring-aspects as aspectLibrary.
I need to exclude some of the aspects contained in it.

I've been trying different matching pattern with the <excludes> tag, without
success.
I came to the conclusion that the exclude tags only affect the waived source
code.

It it really like that?
Do I have anyway to exclude an aspect from an aspectLibrary?

cheers
--
View this message in context: http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31179765.html
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Robert Scholte
2011-03-18 18:26:36 UTC
Permalink
Hi,

we could help you more if you include the part of the pom where you define the plugin, especially the configuration.

-Robert
Date: Fri, 18 Mar 2011 02:44:03 -0700
Subject: [mojo-user] [aspectj-maven-plugin] Excluding aspect from an AspectLibrary?
Hi,
I'm using aspectj-maven-plugin with spring-aspects as aspectLibrary.
I need to exclude some of the aspects contained in it.
I've been trying different matching pattern with the <excludes> tag, without
success.
I came to the conclusion that the exclude tags only affect the waived source
code.
It it really like that?
Do I have anyway to exclude an aspect from an aspectLibrary?
cheers
--
View this message in context: http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31179765.html
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
nodje
2011-03-20 15:03:58 UTC
Permalink
Hi Robert,

sure, here comes the config, I thought it wouldn't be necessary:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<complianceLevel>1.6</complianceLevel>
<encoding>${encoding}</encoding>
<excludes>

<exclude>**/JpaExceptionTranslatorAspect.aj</exclude>
</excludes>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!--<goal>test-compile</goal>-->
</goals>
</execution>
</executions>
</plugin>
Post by Robert Scholte
Hi,
we could help you more if you include the part of the pom where you define
the plugin, especially the configuration.
-Robert
Date: Fri, 18 Mar 2011 02:44:03 -0700
Subject: [mojo-user] [aspectj-maven-plugin] Excluding aspect from an AspectLibrary?
Hi,
I'm using aspectj-maven-plugin with spring-aspects as aspectLibrary.
I need to exclude some of the aspects contained in it.
I've been trying different matching pattern with the <excludes> tag, without
success.
I came to the conclusion that the exclude tags only affect the waived source
code.
It it really like that?
Do I have anyway to exclude an aspect from an aspectLibrary?
cheers
--
http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31179765.html
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
View this message in context: http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31194307.html
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Robert Scholte
2011-03-21 20:08:41 UTC
Permalink
Hi,

quite often it's just a configuration-problem or a typo. The exclusion looks ok (I can't check the typo's of course).
Exclusion should work: here's an integration-test which tests it[1]
If you run maven with an extra '-X' you should see with which arguments aspectj is executed. That could help as well.

-Robert

[1] http://svn.codehaus.org/mojo/trunk/mojo/aspectj-maven-plugin/src/it/ExclusionsAntStyle/
Date: Sun, 20 Mar 2011 08:03:58 -0700
Subject: RE: [mojo-user] [aspectj-maven-plugin] Excluding aspect from an AspectLibrary?
Hi Robert,
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<complianceLevel>1.6</complianceLevel>
<encoding>${encoding}</encoding>
<excludes>
<exclude>**/JpaExceptionTranslatorAspect.aj</exclude>
</excludes>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!--<goal>test-compile</goal>-->
</goals>
</execution>
</executions>
</plugin>
Post by Robert Scholte
Hi,
we could help you more if you include the part of the pom where you define
the plugin, especially the configuration.
-Robert
Date: Fri, 18 Mar 2011 02:44:03 -0700
Subject: [mojo-user] [aspectj-maven-plugin] Excluding aspect from an
AspectLibrary?
Hi,
I'm using aspectj-maven-plugin with spring-aspects as aspectLibrary.
I need to exclude some of the aspects contained in it.
I've been trying different matching pattern with the <excludes> tag, without
success.
I came to the conclusion that the exclude tags only affect the waived source
code.
It it really like that?
Do I have anyway to exclude an aspect from an aspectLibrary?
cheers
--
http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31179765.html
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
View this message in context: http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31194307.html
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
nodje
2011-03-22 09:41:39 UTC
Permalink
Thank you for pointing me toward the project source, very enlightening
indeed.
Exclusion work for aspects coming from the code, no doubt.

But it doesn't seem to apply on library included aspects.

But alas, no test tries to perform an exclusion on an aspect included in an
AspectLibrary.

I'd be willing to add a test that would try to perform this, but
unfortunately I'm not familiar with maven plugin building and the invoker.

Could you please tell me how I can launch a single it test?
Something equivalent to the regular `mvn test -Dtest=<testname>` maybe ??

-nodje
Post by Robert Scholte
Hi,
quite often it's just a configuration-problem or a typo. The exclusion
looks ok (I can't check the typo's of course).
Exclusion should work: here's an integration-test which tests it[1]
If you run maven with an extra '-X' you should see with which arguments
aspectj is executed. That could help as well.
-Robert
[1]
http://svn.codehaus.org/mojo/trunk/mojo/aspectj-maven-plugin/src/it/ExclusionsAntStyle/
Date: Sun, 20 Mar 2011 08:03:58 -0700
Subject: RE: [mojo-user] [aspectj-maven-plugin] Excluding aspect from an AspectLibrary?
Hi Robert,
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<complianceLevel>1.6</complianceLevel>
<encoding>${encoding}</encoding>
<excludes>
<exclude>**/JpaExceptionTranslatorAspect.aj</exclude>
</excludes>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!--<goal>test-compile</goal>-->
</goals>
</execution>
</executions>
</plugin>
Post by Robert Scholte
Hi,
we could help you more if you include the part of the pom where you
define
Post by Robert Scholte
the plugin, especially the configuration.
-Robert
Date: Fri, 18 Mar 2011 02:44:03 -0700
Subject: [mojo-user] [aspectj-maven-plugin] Excluding aspect from an AspectLibrary?
Hi,
I'm using aspectj-maven-plugin with spring-aspects as aspectLibrary.
I need to exclude some of the aspects contained in it.
I've been trying different matching pattern with the <excludes> tag, without
success.
I came to the conclusion that the exclude tags only affect the waived source
code.
It it really like that?
Do I have anyway to exclude an aspect from an aspectLibrary?
cheers
--
http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31179765.html
Post by Robert Scholte
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31194307.html
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
View this message in context: http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31208117.html
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
nodje
2011-03-22 09:55:10 UTC
Permalink
Got it:

mvn invoker:run -Dinvoker.test=ExclusionsAntStyle

does the job.

Though, from the doc, it should be `mvn invoker:run
-DinvokerTest=ExclusionsAntStyle` but this doesn't work.

-nodje
Post by nodje
Hi,
I'm using aspectj-maven-plugin with spring-aspects as aspectLibrary.
I need to exclude some of the aspects contained in it.
I've been trying different matching pattern with the <excludes> tag,
without success.
I came to the conclusion that the exclude tags only affect the waived
source code.
It it really like that?
Do I have anyway to exclude an aspect from an aspectLibrary?
cheers
--
View this message in context: http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31208118.html
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
nodje
2011-03-22 11:28:11 UTC
Permalink
I've built a test that reproduce the problem and attached it as zip file

Haven't been very creative though, just used the spring-aspects as
aspectLibrary, haven't built one specific for the test. Probably not very
stable on the long term.

I could look into the problem itself, but not being a commiter, I'd rather
get it fixed for the next release.
Let me now if I can be of any help.

http://old.nabble.com/file/p31209058/AcpectLibraryExclusionsAntStyle.zip
AcpectLibraryExclusionsAntStyle.zip

-nodje
Post by nodje
mvn invoker:run -Dinvoker.test=ExclusionsAntStyle
does the job.
Though, from the doc, it should be `mvn invoker:run
-DinvokerTest=ExclusionsAntStyle` but this doesn't work.
-nodje
Post by nodje
Hi,
I'm using aspectj-maven-plugin with spring-aspects as aspectLibrary.
I need to exclude some of the aspects contained in it.
I've been trying different matching pattern with the <excludes> tag,
without success.
I came to the conclusion that the exclude tags only affect the waived
source code.
It it really like that?
Do I have anyway to exclude an aspect from an aspectLibrary?
cheers
--
View this message in context: http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31209058.html
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Robert Scholte
2011-03-22 17:59:49 UTC
Permalink
Do you expect JpaExceptionTranslatorAspect.aj to be in the spring-aspects-3.0.5.RELEASE.jar?
It's not there, so exclusion won't have any effect.

-Robert
Date: Tue, 22 Mar 2011 04:28:11 -0700
Subject: Re: [mojo-user] [aspectj-maven-plugin] Excluding aspect from an AspectLibrary?
I've built a test that reproduce the problem and attached it as zip file
Haven't been very creative though, just used the spring-aspects as
aspectLibrary, haven't built one specific for the test. Probably not very
stable on the long term.
I could look into the problem itself, but not being a commiter, I'd rather
get it fixed for the next release.
Let me now if I can be of any help.
http://old.nabble.com/file/p31209058/AcpectLibraryExclusionsAntStyle.zip
AcpectLibraryExclusionsAntStyle.zip
-nodje
Post by nodje
mvn invoker:run -Dinvoker.test=ExclusionsAntStyle
does the job.
Though, from the doc, it should be `mvn invoker:run
-DinvokerTest=ExclusionsAntStyle` but this doesn't work.
-nodje
Post by nodje
Hi,
I'm using aspectj-maven-plugin with spring-aspects as aspectLibrary.
I need to exclude some of the aspects contained in it.
I've been trying different matching pattern with the <excludes> tag,
without success.
I came to the conclusion that the exclude tags only affect the waived
source code.
It it really like that?
Do I have anyway to exclude an aspect from an aspectLibrary?
cheers
--
View this message in context: http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31209058.html
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
nodje
2011-03-23 08:22:14 UTC
Permalink
org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect is right in
spring-aspects.

And it can't be excluded...

I'll post something in issue tracking.
Post by Robert Scholte
Do you expect JpaExceptionTranslatorAspect.aj to be in the
spring-aspects-3.0.5.RELEASE.jar?
It's not there, so exclusion won't have any effect.
-Robert
Date: Tue, 22 Mar 2011 04:28:11 -0700
Subject: Re: [mojo-user] [aspectj-maven-plugin] Excluding aspect from an AspectLibrary?
I've built a test that reproduce the problem and attached it as zip file
Haven't been very creative though, just used the spring-aspects as
aspectLibrary, haven't built one specific for the test. Probably not very
stable on the long term.
I could look into the problem itself, but not being a commiter, I'd rather
get it fixed for the next release.
Let me now if I can be of any help.
http://old.nabble.com/file/p31209058/AcpectLibraryExclusionsAntStyle.zip
AcpectLibraryExclusionsAntStyle.zip
-nodje
Post by nodje
mvn invoker:run -Dinvoker.test=ExclusionsAntStyle
does the job.
Though, from the doc, it should be `mvn invoker:run
-DinvokerTest=ExclusionsAntStyle` but this doesn't work.
-nodje
Post by nodje
Hi,
I'm using aspectj-maven-plugin with spring-aspects as aspectLibrary.
I need to exclude some of the aspects contained in it.
I've been trying different matching pattern with the <excludes> tag,
without success.
I came to the conclusion that the exclude tags only affect the waived
source code.
It it really like that?
Do I have anyway to exclude an aspect from an aspectLibrary?
cheers
--
http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31209058.html
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
View this message in context: http://old.nabble.com/-aspectj-maven-plugin--Excluding-aspect-from-an-AspectLibrary--tp31179765p31217618.html
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Loading...