1、创建一个Maven工程加载Shiro的jar包
1 <!-- junit --> 2 <dependency> 3 <groupId>junit</groupId> 4 <artifactId>junit</artifactId> 5 <version>4.12</version> 6 <scope>test</scope> 7 </dependency> 8 <!-- Logging with SLF4J & LogBack --> 9 <dependency> 10 <groupId>org.slf4j</groupId> 11 <artifactId>jcl-over-slf4j</artifactId> 12 <version>1.7.13</version> 13 </dependency> 14 <dependency> 15 <groupId>org.slf4j</groupId> 16 <artifactId>slf4j-api</artifactId> 17 <version>1.7.13</version> 18 </dependency> 19 <dependency> 20 <groupId>org.slf4j</groupId> 21 <artifactId>jul-to-slf4j</artifactId> 22 <version>1.7.13</version> 23 </dependency> 24 <dependency> 25 <groupId>ch.qos.logback</groupId> 26 <artifactId>logback-classic</artifactId> 27 <version>1.1.3</version> 28 </dependency> 29 <dependency> 30 <groupId>ch.qos.logback</groupId> 31 <artifactId>logback-core</artifactId> 32 <version>1.1.3</version> 33 </dependency> 34 <dependency> 35 <groupId>ch.qos.logback</groupId> 36 <artifactId>logback-access</artifactId> 37 <version>1.1.3</version> 38 </dependency> 39 <!-- shiro --> 40 <dependency> 41 <groupId>org.apache.shiro</groupId> 42 <artifactId>shiro-core</artifactId> 43 <version>1.2.4</version> 44 </dependency> 45 <!-- apache commons --> 46 <dependency> 47 <groupId>commons-logging</groupId> 48 <artifactId>commons-logging</artifactId> 49 <version>1.2</version> 50 </dependency>