请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

求救!db.driverLocation路径问题!

我已经从源码的tools里面将bin.jar拷贝了出来,并且将driverlocation指向了相应位置,却仍然无法generate


报错:

objc[4579]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.

[INFO] Scanning for projects...

[WARNING] 

[WARNING] Some problems were encountered while building the effective model for com:mastermall:war:1.0-SNAPSHOT

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 264, column 15

[WARNING] 

[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

[WARNING] 

[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

[WARNING] 

[INFO]                                                                         

[INFO] ------------------------------------------------------------------------

[INFO] Building mastermall Maven Webapp 1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO] 

[INFO] --- mybatis-generator-maven-plugin:1.3.2:generate (default-cli) @ mastermall ---

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1.728s

[INFO] Finished at: Mon Jan 22 01:52:25 EST 2018

[INFO] Final Memory: 6M/64M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project mastermall: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Cannot resolve classpath entry: ${db.driverLocation} -> [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

配置文件:

db.driverLocation= /Library/developer/mysql-connector-java-5.1.6-bin.jar
db.driverClassName=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/mastermall?characterEncoding=utf-8
db.username=mastermall
db.password=mastermall

正在回答 回答被采纳积分+3

3回答

提问者 睡鼠Zzz 2018-01-23 03:26:08

没事了,我的等号不小心打成日文格式的了。

1 回复 有任何疑惑可以回复我~
  • Geely #1
    解决了就好..这个日文格式好神奇。。辛苦同学,最近单位特别忙,刚下班。回复晚了。海涵呀。
    回复 有任何疑惑可以回复我~ 2018-01-25 23:43:39

如果有同学在这里出现问题的话,用log打印出来日志(打log方法:https://blog.csdn.net/sunny243788557/article/details/45166397)

,然后如果错误中有https://img1.sycdn.imooc.com//szimg/5ac721750001683311980319.jpg,请返回datasource,把数据库的ip地址db.url改为 本地(127.0.0.1 或者localhost)。

0 回复 有任何疑惑可以回复我~
星辰Iron 2018-01-22 21:57:50

你好同学,改成绝对路径再试试,类似于下面这种形式

db.driverLocation=E:/imooc/mysql-connector-java-5.1.6-bin.jar


0 回复 有任何疑惑可以回复我~
  • 提问者 睡鼠Zzz #1
    问题是mac的绝对路径的起始盘找不到。。。我用Macintosh HD作为路径开头也不起作用。。。折腾了很久一直弄不好我很难过。。。
    回复 有任何疑惑可以回复我~ 2018-01-22 23:25:20
  • 提问者 睡鼠Zzz #2
    会不会是这个问题啊,不过我还是觉得应该是路径没搞对。。。
    
    [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 264, column 15
    回复 有任何疑惑可以回复我~ 2018-01-22 23:29:27
  • 提问者 睡鼠Zzz #3
    因为我的jdk是1.8的,所以配置pom.xml的时候,warning里面提到的@line 264已经更改成1.8
    
    <!-- geelynote maven的核心插件之-complier插件默认只支持编译Java 1.4,因此需要加上支持高版本jre的配置,在pom.xml里面加上 增加编译插件 -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <source>1.8</source>
              <target>1.8</target>
              <encoding>UTF-8</encoding>
              <compilerArguments>
                <extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
              </compilerArguments>
            </configuration>
          </plugin>
        </plugins>
    回复 有任何疑惑可以回复我~ 2018-01-22 23:48:49
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信