mybatis-generator运行报错Failed to execute goal org.mybatis.generator:myba...
"C:Program FilesJavajdk-9.0.4binjava.exe" -Dmaven.multiModuleProjectDirectory=E:testone "-Dmaven.home=D:IDEAIntelliJ IDEA 2018.3pluginsmavenlibmaven3" "-Dclassworlds.conf=D:IDEAIntelliJ IDEA 2018.3pluginsmavenlibmaven3binm2.conf" "-javaagent:D:IDEAIntelliJ IDEA 2018.3libidea_rt.jar=4358:D:IDEAIntelliJ IDEA 2018.3bin" -Dfile.encoding=UTF-8 -classpath "D:IDEAIntelliJ IDEA 2018.3pluginsmavenlibmaven3bootplexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.3 mybatis-generator:generate
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testone 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- mybatis-generator-maven-plugin:1.3.5:generate (default-cli) @ testone ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.881 s
[INFO] Finished at: 2019-02-10T23:37:32+08:00
[INFO] Final Memory: 17M/57M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.5:generate (default-cli) on project testone: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.5:generate failed: Cannot resolve classpath entry: F:workspaceniuwa-p2psWebContentWEB-INFlibmysql-connector-java-5.1.25.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Process finished with exit code 1
这种情况是pom的配置错了
由于使用了mysql8.0以上的版本,因此在配置里也要改成8.0的version,而不是5的version
正确如下:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.testone</groupId> <artifactId>testone</artifactId> <version>1.0-SNAPSHOT</version> <name>testone</name> <!-- FIXME change it to the project's website --> <url>http://www.example.com</url> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.5.RELEASE</version> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.15</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.1</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> </dependencies> <build> <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> <plugins> <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>3.1.0</version> </plugin> <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>3.0.2</version> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <version>3.0.2</version> </plugin> <plugin> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> </plugin> <plugin> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> </plugin> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.7</version> <dependencies> <dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-core</artifactId> <version>1.3.7</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.15</version> </dependency> </dependencies> <executions> <execution> <id>mybatis generator</id> <phase>package</phase> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <!--允许移动生成的文件--> <verbose>true</verbose> <!--允许自动覆盖的文件--> <overwrite>true</overwrite> <configurationFile> src/main/resources/mybatis-generator.xml </configurationFile> </configuration> </plugin> <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> <plugin> <artifactId>maven-site-plugin</artifactId> <version>3.7.1</version> </plugin> <plugin> <artifactId>maven-project-info-reports-plugin</artifactId> <version>3.0.0</version> </plugin> </plugins> </pluginManagement> </build> </project>

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
[python作业AI毕业设计博客]Functional Programming For Dummies - 2019 函数式编程傻瓜书
函数式编程范例指南 下载地址:https://itbooks.pipipan.com/fs/18113597-335607573 函数式编程主要用于数学计算,包括人工智能和游戏中使用的算法。这种编程范例使得用于数学计算的算法更容易理解,并为非开发人员提供了一种编码算法的简洁方法。目前市场上的书籍具有陡峭的学习曲线,因为它们大多是由开发人员为开发人员编写的。 本书探讨了纯粹(由Haskell语言表示)和不纯(用Python语言表示)方法之间的差异,为像您一样的读者进行函数式编程。纯方法最适合那些不想创建生产代码但需要完全测试算法并证明它们对同行有用的研究人员。不纯的方法最适合生产环境,因为可以在单个应用程序中混合编码范例以更快地生成结果。函数式编程傻瓜书使用这种双管齐下的方法为您提供一种编码方法的一体化方法,否则很难掌握。 •在编码时学习纯粹和不纯洁•深入了解大多数功能程序员用来推导,分析和证明算法价值的过程•受益于Python和Haskell中提供的示例•收集专家作者的专业知识,该作者迄今已编写了一些市场领先的编程书籍 如果您已准备好按摩数据以了解事物如何以新的方式运作,那么您来对地方...
- 下一篇
mybatis-generator运行报错Communications link failure
原因分析:mysql使用了8.0以上的版本。搜索得到的结果:第一种方法,在jdbcURL上加上了 ?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true 使用了之后呢,然后过了一段时间,还是报那个Communications link failure 错误。 于是就采用第二种方法:在mysql的my.ini里面加上这两个参数wait_timeout=2147483interactive_timeout=2147483因为帖子里说是在默认配置不改变的情况下,如果连续8小时内都没有访问数据库的操作,再次访问mysql数据库的时候,mysql数据库会拒绝访问,于是那就加上吧 加了之后呢,又开始测,过了一段时间,还是报Communications link failure 错误,这下彻底凉了,于是继续翻看着, 第三种方法:把jdbcURl的ip地址链接,改成localhost,(果然大神们的帖子都是干练到极致,小弟佩服)于是我就将自...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- CentOS6,7,8上安装Nginx,支持https2.0的开启
- CentOS7编译安装Gcc9.2.0,解决mysql等软件编译问题
- Linux系统CentOS6、CentOS7手动修改IP地址
- Docker安装Oracle12C,快速搭建Oracle学习环境
- CentOS7设置SWAP分区,小内存服务器的救世主
- CentOS7编译安装Cmake3.16.3,解决mysql等软件编译问题
- CentOS7,8上快速安装Gitea,搭建Git服务器
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- CentOS8安装MyCat,轻松搞定数据库的读写分离、垂直分库、水平分库
- Windows10,CentOS7,CentOS8安装Nodejs环境