roncoo / roncoo-mybatis-generator

龙果开源-Mybatis代码自动生成工具
165 stars 120 forks source link

为啥在maven公共库种没有检索到? #2

Open hadesvip opened 4 years ago

fengyws commented 4 years ago

这个工具没上传到公开库,当是个工程使用就好

hadesvip commented 4 years ago

install 到本地仓库成功了如下图 image 但是在一个普通项目中引入插件 image

image

出现如上问题

#######

是我操作的方式不对么? 有操作文档之类的么?

谢谢

fengyws commented 4 years ago

不要打包,直接在里面运行main方法即可

hadesvip commented 4 years ago

项目结构

image

mybatisConfig.xml文件内容

`

<classPathEntry
        location="/Users/wangyong/.m2/repository/mysql/mysql-connector-java/8.0.19/mysql-connector-java-8.0.19.jar"/>
<context id="context" targetRuntime="MyBatis3">
    <commentGenerator>
        <property name="suppressDate" value="true"/>
        <property name="suppressAllComments" value="true"/>
    </commentGenerator>
    <!--数据库链接地址账号密码-->
    <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
                    connectionURL="jdbc:mysql://localhost:3306/pay?serverTimezone=UTC" userId="root"
                    password="root">
    </jdbcConnection>
    <javaTypeResolver>
        <property name="forceBigDecimals" value="false"/>
    </javaTypeResolver>
    <!--生成Model类存放位置-->
    <javaModelGenerator targetPackage="com.kevin.pay.domain" targetProject="src/main/java">
        <property name="enableSubPackages" value="true"/>
        <property name="trimStrings" value="true"/>
    </javaModelGenerator>
    <!--生成映射文件存放位置-->
    <sqlMapGenerator targetPackage="mybatis.mapper" targetProject="src/main/resources">
        <property name="enableSubPackages" value="true"/>
    </sqlMapGenerator>
    <!--生成Dao类存放位置-->
    <javaClientGenerator type="XMLMAPPER" targetPackage="com.kevin.pay.dao" targetProject="src/main/java">
        <property name="enableSubPackages" value="true"/>
    </javaClientGenerator>
    <!--生成对应表及类名-->
    <table tableName="trade" schema="trade"/>
</context>

`

运行出现如下错误

`/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java -javaagent:/Users/wangyong/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/202.6397.94/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=55719:/Users/wangyong/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/202.6397.94/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/wangyong/programming/java_dev/code/opensource/roncoo-mybatis-generator/target/classes:/Users/wangyong/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/wangyong/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar com.roncoo.mybatis.generator.plugins.PaginationPlugin Exception in thread "main" java.lang.ExceptionInInitializerError at com.roncoo.mybatis.generator.config.xml.ParserErrorHandler.error(ParserErrorHandler.java:60) at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:138) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284) at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1539) at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1806) at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:728) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1397) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1292) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3063) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:836) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246) at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at com.roncoo.mybatis.generator.config.xml.ConfigurationParser.parseConfiguration(ConfigurationParser.java:110) at com.roncoo.mybatis.generator.config.xml.ConfigurationParser.parseConfiguration(ConfigurationParser.java:83) at com.roncoo.mybatis.generator.config.xml.ConfigurationParser.parseConfiguration(ConfigurationParser.java:75) at com.roncoo.mybatis.generator.api.ShellRunner.main(ShellRunner.java:107) at com.roncoo.mybatis.generator.plugins.PaginationPlugin.generate(PaginationPlugin.java:90) at com.roncoo.mybatis.generator.plugins.PaginationPlugin.main(PaginationPlugin.java:93) Caused by: java.util.MissingResourceException: Can't find bundle for base name org.mybatis.generator.internal.util.messages.messages, locale zhCN#Hans at java.base/java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:2055) at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1689) at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1593) at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1556) at java.base/java.util.ResourceBundle.getBundle(ResourceBundle.java:857) at com.roncoo.mybatis.generator.internal.util.messages.Messages.(Messages.java:29) ... 25 more

Process finished with exit code 1 `

上述问题是不是还缺什么配置文件

能分享一个可运行的demo么? 邮箱yundan_wy@126.com

fengyws commented 4 years ago

jdk11版本太高,用jdk8

hadesvip commented 4 years ago

换了jdk1.8 版本还是一样的问题

idea 启动日记如下

`/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/bin/java -javaagent:/Users/wangyong/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/202.6948.69/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=61385:/Users/wangyong/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/202.6948.69/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/lib/tools.jar:/Users/wangyong/programming/java_dev/code/opensource/roncoo-mybatis-generator/target/classes:/Users/wangyong/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/wangyong/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar com.roncoo.mybatis.generator.plugins.PaginationPlugin Exception in thread "main" java.lang.ExceptionInInitializerError at com.roncoo.mybatis.generator.config.xml.ParserErrorHandler.error(ParserErrorHandler.java:60) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:137) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1599) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1877) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1289) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at com.roncoo.mybatis.generator.config.xml.ConfigurationParser.parseConfiguration(ConfigurationParser.java:110) at com.roncoo.mybatis.generator.config.xml.ConfigurationParser.parseConfiguration(ConfigurationParser.java:83) at com.roncoo.mybatis.generator.config.xml.ConfigurationParser.parseConfiguration(ConfigurationParser.java:75) at com.roncoo.mybatis.generator.api.ShellRunner.main(ShellRunner.java:107) at com.roncoo.mybatis.generator.plugins.PaginationPlugin.generate(PaginationPlugin.java:90) at com.roncoo.mybatis.generator.plugins.PaginationPlugin.main(PaginationPlugin.java:93) Caused by: java.util.MissingResourceException: Can't find bundle for base name org.mybatis.generator.internal.util.messages.messages, locale zh_CN at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1581) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1396) at java.util.ResourceBundle.getBundle(ResourceBundle.java:782) at com.roncoo.mybatis.generator.internal.util.messages.Messages.(Messages.java:29) ... 25 more

Process finished with exit code 1 `