楼主厉害啊,不会使用maven,需要导入啥jar

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了楼主厉害啊,不会使用maven,需要导入啥jar相关的知识,希望对你有一定的参考价值。

下面是maven导出的依赖关系,最好学习一下怎么使用maven,虽然依赖不是很多,但jar的依赖关系也得整理好半天,比较麻烦
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ dreampie ---
[INFO] cn.dreampie:dreampie:war:1.0-SNAPSHOT
[INFO] +- junit:junit:jar:4.10:test
[INFO] | \\- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] +- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] +- ch.qos.logback:logback-core:jar:1.0.13:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.0.13:compile
[INFO] +- com.h2database:h2:jar:1.4.178:compile
[INFO] +- com.jfinal:jfinal:jar:1.8:compile
[INFO] +- com.jfinal:jfinal-ext:jar:3.1.0:compile
[INFO] | +- mysql:mysql-connector-java:jar:5.1.24:compile
[INFO] | +- it.sauronsoftware.cron4j:cron4j:jar:2.2.5:compile
[INFO] | +- net.sf.ehcache:ehcache:jar:2.7.2:compile
[INFO] | +- com.google.guava:guava:jar:14.0.1:compile
[INFO] | +- com.servlets:cos:jar:05Nov2002:compile
[INFO] | +- com.jfinal:jetty-server:jar:8.1.8:compile
[INFO] | | +- org.eclipse.jetty:jetty-xml:jar:8.1.8.v20121106:compile
[INFO] | | | \\- org.eclipse.jetty:jetty-util:jar:8.1.8.v20121106:compile
[INFO] | | \\- org.eclipse.jetty:jetty-servlet:jar:8.1.8.v20121106:compile
[INFO] | | \\- org.eclipse.jetty:jetty-security:jar:8.1.8.v20121106:compile
[INFO] | | \\- org.eclipse.jetty:jetty-server:jar:8.1.8.v20121106:compile
[INFO] | | +- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:compile
[INFO] | | +- org.eclipse.jetty:jetty-continuation:jar:8.1.8.v20121106:compile
[INFO] | | \\- org.eclipse.jetty:jetty-http:jar:8.1.8.v20121106:compile
[INFO] | | \\- org.eclipse.jetty:jetty-io:jar:8.1.8.v20121106:compile
[INFO] | +- com.alibaba:druid:jar:0.2.25:compile
[INFO] | \\- redis.clients:jedis:jar:2.2.1:compile
[INFO] | \\- commons-pool:commons-pool:jar:1.6:compile
[INFO] +- joda-time:joda-time:jar:2.3:compile
[INFO] +- org.apache.shiro:shiro-core:jar:1.2.3:compile
[INFO] | \\- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] +- org.apache.shiro:shiro-web:jar:1.2.3:compile
[INFO] +- org.apache.shiro:shiro-ehcache:jar:1.2.2:compile
[INFO] +- net.sf.ehcache:ehcache-core:jar:2.6.6:compile
[INFO] +- org.freemarker:freemarker:jar:2.3.20:compile
[INFO] +- commons-beanutils:commons-beanutils-core:jar:1.8.3:compile
[INFO] | \\- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.2:compile
[INFO] +- org.quartz-scheduler:quartz:jar:2.2.1:compile
[INFO] | \\- c3p0:c3p0:jar:0.9.1.1:compile
[INFO] +- org.flywaydb:flyway-core:jar:3.0:compile
[INFO] +- org.apache.commons:commons-email:jar:1.3.2:compile
[INFO] | +- javax.mail:mail:jar:1.4.5:compile
[INFO] | \\- javax.activation:activation:jar:1.1.1:compile
[INFO] +- com.typesafe.akka:akka-actor_2.10:jar:2.3.2:compile
[INFO] | +- org.scala-lang:scala-library:jar:2.10.3:compile
[INFO] | \\- com.typesafe:config:jar:1.2.0:compile
[INFO] +- com.alibaba:fastjson:jar:1.1.41:compile
[INFO] +- org.atmosphere:atmosphere-runtime:jar:2.2.0-RC1:compile
[INFO] +- org.atmosphere.client:javascript:war:2.2.1:compile
[INFO] +- org.apache.geronimo.specs:geronimo-servlet_3.0_spec:jar:1.0:provided
[INFO] \\- eu.infomas:annotation-detector:jar:3.0.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.376s
[INFO] Finished at: Wed Jun 25 14:23:55 CST 2014
[INFO] Final Memory: 10M/113M
[INFO] ------------------------------------------------------------------------
参考技术A 你可以直接在百度上搜索 “manyjar” 或 “jar包” 这个两个关键词,有个交manyjar的网站,有非常多的jar可以使用。推荐你使用

@MapperScan注解需要在pom.xml导入啥

如下:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE generatorConfiguration

PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"

"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">

<generatorConfiguration>

<properties resource="application.properties"/>

<context id="Mysql" targetRuntime="MyBatis3Simple" defaultModelType="flat">

<property name="beginningDelimiter" value="`"/>

在SpringBoot中集成MyBatis,可以在mapper接口上添加@Mapper注解,将mapper注入到Spring,但是如果每一给mapper都添加@mapper注解会很麻烦,这时可以使用@MapperScan注解来扫描包。

经测试发现,@MapperScan注解只会扫描包中的接口,不会扫描类,所以可以在包中写Provider类。

@MapperScan("com.demo.mapper"):扫描指定包中的接口。

@MapperScan("com.demo.*.mapper"):一个*代表任意字符串,但只代表一级包,比如可以扫到com.demo.aaa.mapper,不能扫到com.demo.aaa.bbb.mapper.

@MapperScan("com.demo.**.mapper"):两个*代表任意个包,比如可以扫到。com.demo.aaa.mapper,也可以扫到com.demo.aaa.bbb.mapper.

参考技术A <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">

<generatorConfiguration>
<properties resource="application.properties"/>

<context id="Mysql" targetRuntime="MyBatis3Simple" defaultModelType="flat">
<property name="beginningDelimiter" value="`"/>
参考技术B <dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>2.0.0</version>
</dependency>
缺少一个mybatis-spring的包

以上是关于楼主厉害啊,不会使用maven,需要导入啥jar的主要内容,如果未能解决你的问题,请参考以下文章

Maven是什么

java需要加入啥包?

java项目中有个pom.xml,我怎么导入这个项目啊

IDEA maven中引入的依赖不自动导入项目

怎么把本地spring jar包导入maven

如何利用maven向本地仓库导入官网没有的jar包