- /src/main/java folder contains source files for the dynamic content of the application
- /src/test/java folder contains all source files for unit tests
- /src/main/webapp folder contains essential files for creating a valid web application, e.g. „web.xml“
- /target folder contains the compiled and packaged deliverables
- The „pom.xml“ is the project object model (POM) file. The single file that contains all project related configuration.
- Locate the „Properties“ section at the „Overview“ page of the POM editor and perform the following changes :
- Create a new property with name org.springframework.version and value3.0.1.RELEASE
- Create a new property with name maven.compiler.source and value according to the version of your Java runtime environment, we will use 1.6
- Create a new property with name maven.compiler.target and value according to the version of your Java runtime environment, we will use 1.6
- Navigate to the „Dependencies“ page of the POM editor and create the following dependencies (you should fill the „GroupId“, „Artifact Id“ and „Version“ fields of the „Dependency Details“ section at that page) :
- Group Id : org.springframework Artifact Id : spring-web Version :${org.springframework.version}
- Group Id : org.aspectj Artifact Id : aspectjrt Version : 1.6.7
- Navigate to the “Plugins” page of the POM editor and create the following plugin (you should fill the „GroupId“, „Artifact Id“ and „Version“ fields of the „Plugin Details“ section at that page) :
- Group Id : org.codehaus.mojo Artifact Id : aspectj-maven-plugin Version : 1.3
- At the “Plugins” page of the POM editor, select the newly created plugin (from the “Plugins” section), and bind it to the compile execution goal. To do so, locate the “Execution” section and create a new execution. At the “Execution Details” section create a new goal and name it “compile”
- The newly created plugin needs one final configuration change. We must define what version of Java runtime environment we are using in order for the AspectJ compiler to properly weave aspect classes. We need to edit the “pom.xml” file to perform the change. Select the “pom.xml” page of the POM editor, locate the newly created plugin and alter it as follows :
- Finally change the “maven-compiler-plugin” as shown below :
01 | < plugin > |
02 | < groupId >org.codehaus.mojo groupId > |
03 | < artifactId >aspectj-maven-plugin artifactId > |
04 | < version >1.3 version > |
05 | < configuration > |
06 | < source >${maven.compiler.source} source > |
07 | < target >${maven.compiler.target} target > |
08 |
configuration > |
09 | < executions > |
10 | < execution > |
11 | < goals > |
12 | < goal >compile goal > |
13 |
goals > |
14 |
execution > |
15 |
executions > |
16 |
plugin > |
1 | < plugin > |
2 | < groupId >org.apache.maven.plugins groupId > |
3 | < artifactId >maven-compiler-plugin artifactId > |
4 | < version >2.0.2 version > |
5 | < configuration > |
6 | < source >${maven.compiler.source} source > |
7 | < target >${maven.compiler.target} target > |
8 |
configuration > |
9 |
plugin > |
No comments:
Post a Comment