Announcement Announcement Module
Collapse
No announcement yet.
Spring AOP aspect library Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring AOP aspect library

    Dear All,
    I have created a Spring AOP logging Aspect and its working fine when the codes and the context file are in the same module as my target classes.

    What I would like to do is to move the Spring AOP logging Aspect in a seperate module (which I've done using maven) and then import this within any other projects where I need to use the Spring AOP logging .

    Since I use maven within my build I've created a seperate spring AOP module and I've used the aspectj-maven-plugin to add my module as a library within the configuration setting of my aspect-maven-plugin.

    However this is not working as the codes are not being weaved , note I've imported the required Spring AOP logging module application context files within my main project context file.

    So question am asking myself is :

    1. Should aspect libraries be pure aspectj or is Spring AOP aspects supported?
    2. Is there any means of achieving the re-use of existing Spring AOP aspects?

    Code:
    <build>
    
    		<plugins>
    
    			<plugin>
    				<groupId>org.codehaus.mojo</groupId>
    				<artifactId>aspectj-maven-plugin</artifactId>
    				<version>1.4</version>
    				<executions>
    					<execution>
    						<goals>
    							<goal>compile</goal>
    							<goal>test-compile</goal>
    						</goals>
    					</execution>
    				</executions>
    				<configuration>
    					<aspectLibraries>
    						<aspectLibrary>
    							<groupId>my.aspect.logging</groupId>
    							<artifactId>aspectj-logging</artifactId>
    						</aspectLibrary>
    					</aspectLibraries>
    					<source>1.6</source>
    					<target>1.6</target>
    				</configuration>
    			</plugin>
    		</plugins>
    	</build>
Working...
X