1. Create a new folder in the root directory;
2. Make an absolute reference to the project file in the pom file;
an example is as follows:
For example, if you need to introduce struts unit test related packages into the project, you can configure the following in maven:
<!-- Unit testing only --> <dependency> <groupId>cn.mamp</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> <type>jar</type> <scope>system</scope> <systemPath>${basedir}/junitlib/jsp-api-2.0.jar</systemPath> </dependency> <dependency> <groupId>cn.mamp</groupId> <artifactId>spring-test</artifactId> <version>3.0.5</version> <type>jar</type> <scope>system</scope> <systemPath>${basedir}/junitlib/spring-test-3.0.5.RELEASE.jar</systemPath> </dependency> <dependency> <groupId>cn.mamp</groupId> <artifactId>struts2-junit</artifactId> <version>2.3.32</version> <type>jar</type> <scope>system</scope> <systemPath>${basedir}/junitlib/struts2-junit-plugin-2.3.32.jar</systemPath> </dependency> <!-- Unit testing only -->
Maven built-in variable description:
- ${basedir} project root directory
- ${project.build.directory} build directory, default is target
- ${project.build.outputDirectory} build process output directory, default is target/classes
- ${project.build.finalName} Artifact name, default is ${project.artifactId}-${project.version}
- ${project.packaging} packaging type, the default is jar
- ${project.xxx} The content of any node of the current pom file