Permalink
Browse files

Added a simple aspect, seems to work...

  • Loading branch information...
1 parent 9f41a04 commit 1b2f3b2b185b91ed92d7d6d07d9bcc43f5b16b4a @enhan committed Apr 29, 2012
View
2 .gitignore
@@ -5,5 +5,5 @@
.classpath
target/
build/
-
+ajcore*
View
46 pom.xml
@@ -17,6 +17,21 @@
</properties>
+ <repositories>
+ <repository>
+ <id>maven.springframework.org</id>
+ <name>SpringSource milestones</name>
+ <url>http://maven.springframework.org/milestone</url>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>maven.springframework.org</id>
+ <name>SpringSource milestones</name>
+ <url>http://maven.springframework.org/milestone</url>
+ </pluginRepository>
+ </pluginRepositories>
<dependencies>
@@ -30,11 +45,6 @@
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>${aspectj.version}</version>
- </dependency>
<dependency>
@@ -56,22 +66,22 @@
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.4</version>
-<!-- <dependencies> -->
-<!-- <dependency> -->
-<!-- <groupId>org.aspectj</groupId> -->
-<!-- <artifactId>aspectjrt</artifactId> -->
-<!-- <version>${aspectj.version}</version> -->
-<!-- </dependency> -->
-<!-- <dependency> -->
-<!-- <groupId>org.aspectj</groupId> -->
-<!-- <artifactId>aspectjtools</artifactId> -->
-<!-- <version>${aspectj.version}</version> -->
-<!-- </dependency> -->
-<!-- </dependencies> -->
+ <dependencies>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>${aspectj.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjtools</artifactId>
+ <version>${aspectj.version}</version>
+ </dependency>
+ </dependencies>
<configuration>
<showWeaveInfo>true</showWeaveInfo>
- <complianceLevel>${maven.compiler.source}</complianceLevel>
+<!-- <complianceLevel>${maven.compiler.source}</complianceLevel> -->
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>${maven.compiler.encoding}</encoding>
View
19 src/main/java/eu/enhan/socialist/model/SampleAspect.aj
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+package eu.enhan.socialist.model;
+
+/**
+ * @author Emmanuel Nhan
+ *
+ */
+public aspect SampleAspect {
+
+ pointcut userInit() : execution(public void User.setName(String));
+
+ before() : userInit() {
+ System.out.println("Teste pointcut");
+ }
+
+
+}
View
1 src/test/java/eu/enhan/socialist/test/model/UserTest.java
@@ -27,5 +27,6 @@ public void testEqualsDefault(){
assertFalse(u3.equals(u));
}
+
}

0 comments on commit 1b2f3b2

Please sign in to comment.