diff --git a/aspectj/plugin.jelly b/aspectj/plugin.jelly index cfbd61c9..4c72906c 100644 --- a/aspectj/plugin.jelly +++ b/aspectj/plugin.jelly @@ -30,6 +30,7 @@ xmlns:define="jelly:define" xmlns:log="jelly:log" xmlns:maven="jelly:maven" + xmlns:util="jelly:util" xmlns:aspectj="aspectj"> - - + + - + + + + + + + \ No newline at end of file diff --git a/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/Sample.aj b/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/Sample.aj index 2553192e..608114a8 100644 --- a/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/Sample.aj +++ b/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/Sample.aj @@ -20,17 +20,17 @@ package org.apache.maven.aspectj; public aspect Sample { pointcut srcPointcut() : - execution(public * org.apache.maven.aspectj.Dummy.someMethod()); + execution(public * org.apache.maven.aspectj.Dummy.someMethod()); pointcut testPointcut() : - execution(public * org.apache.maven.aspectj.AspectTest.someMethod()); + execution(public * org.apache.maven.aspectj.AspectTest.someMethod()); - before() : srcPointcut() - { - throw new RuntimeException("test exception voluntarily raised and that should be caught in the test case"); - } + before() : srcPointcut() + { + throw new RuntimeException("test exception voluntarily raised and that should be caught in the test case"); + } - before() : testPointcut() - { - throw new RuntimeException("test exception voluntarily raised and that should be caught in the test case"); - } + before() : testPointcut() + { + throw new RuntimeException("test exception voluntarily raised and that should be caught in the test case"); + } } \ No newline at end of file diff --git a/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/TestA.aj b/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/TestA.aj new file mode 100644 index 00000000..d8774ced --- /dev/null +++ b/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/TestA.aj @@ -0,0 +1,30 @@ +package org.apache.maven.aspectj; + +/* ==================================================================== + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ==================================================================== + */ + +public aspect TestA +{ + pointcut srcPointcut(Dummy dummy) : + execution(public * org.apache.maven.aspectj.Dummy.isAspectAWeaved()) + && target(dummy); + + before(Dummy dummy) : srcPointcut(dummy) + { + dummy.setAspectAWeaved(true); + } +} \ No newline at end of file diff --git a/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/TestB.aj b/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/TestB.aj new file mode 100644 index 00000000..87eb0d12 --- /dev/null +++ b/aspectj/src/plugin-test/src/aspect/org/apache/maven/aspectj/TestB.aj @@ -0,0 +1,30 @@ +package org.apache.maven.aspectj; + +/* ==================================================================== + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ==================================================================== + */ + +public aspect TestB +{ + pointcut srcPointcut(Dummy dummy) : + execution(public * org.apache.maven.aspectj.Dummy.isAspectBWeaved()) + && target(dummy); + + before(Dummy dummy) : srcPointcut(dummy) + { + dummy.setAspectBWeaved(true); + } +} \ No newline at end of file diff --git a/aspectj/src/plugin-test/src/main/org/apache/maven/aspectj/Dummy.java b/aspectj/src/plugin-test/src/main/org/apache/maven/aspectj/Dummy.java index 95c77893..4b9d1a90 100644 --- a/aspectj/src/plugin-test/src/main/org/apache/maven/aspectj/Dummy.java +++ b/aspectj/src/plugin-test/src/main/org/apache/maven/aspectj/Dummy.java @@ -19,7 +19,32 @@ package org.apache.maven.aspectj; public class Dummy { + + private boolean aspectA; + + private boolean aspectB; + public void someMethod() { } -} \ No newline at end of file + + public boolean isAspectAWeaved() + { + return this.aspectA; + } + + public boolean isAspectBWeaved() + { + return this.aspectB; + } + + public void setAspectAWeaved(boolean isSet) + { + this.aspectA = isSet; + } + + public void setAspectBWeaved(boolean isSet) + { + this.aspectB = isSet; + } +} diff --git a/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java b/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java index 4db09d36..e6e0d973 100644 --- a/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java +++ b/aspectj/src/plugin-test/src/test/org/apache/maven/aspectj/AspectTest.java @@ -20,12 +20,13 @@ import junit.framework.TestCase; public class AspectTest extends TestCase { - + private static final String EXCEPTION_MESSAGE = "test exception " + "voluntarily raised and that should be caught in the test case"; - + public void testSourceIsCorrectlyWeaved() { + String argfiles = System.getProperty("maven.aspectj.argfiles"); Dummy dummy = new Dummy(); try { @@ -35,6 +36,16 @@ public class AspectTest extends TestCase { assertEquals(EXCEPTION_MESSAGE, expected.getMessage()); } + + if (argfiles == null) + { + assertTrue(dummy.isAspectAWeaved()); + assertTrue(dummy.isAspectBWeaved()); + } else + { + assertTrue(dummy.isAspectAWeaved()); + assertFalse(dummy.isAspectBWeaved()); + } } public void testTestIsCorrectlyWeaved() diff --git a/aspectj/xdocs/changes.xml b/aspectj/xdocs/changes.xml index 1ae7d719..427ab5ea 100644 --- a/aspectj/xdocs/changes.xml +++ b/aspectj/xdocs/changes.xml @@ -28,12 +28,15 @@ + Added + maven.aspectj.argfiles and + maven.aspectj.weaveAspectSources properties. Added maven.aspectj.noweave and - maven.aspectj.lintproperties. + maven.aspectj.lint properties. Added maven.aspectj.source and - maven.aspectj.timeproperties that where incorrectly removed. + maven.aspectj.time properties that where incorrectly removed. Check that unitTestSourceDirectory is defined in pom diff --git a/aspectj/xdocs/properties.xml b/aspectj/xdocs/properties.xml index 6d3ea7d9..8edf7b53 100644 --- a/aspectj/xdocs/properties.xml +++ b/aspectj/xdocs/properties.xml @@ -37,6 +37,30 @@ Description + + maven.aspectj.argfiles + Yes + + List of argument files separated by commas. + An argument file contains a list of arguments read by the + compiler. Each line is read into one element of the argument + array and may include another argfile by reference. + If specified, maven.aspectj.weaveAspectSources + is set to a default false value. + + + + + maven.aspectj.weaveAspectSources + Yes + + If true weave aspect sources in + pom.build.aspectSourceDirectory. + Default true, false if + maven.aspectj.argfiles is specified. + + + maven.aspectj.sourceRootCopyFilter Yes