发表于: 2017-03-26 00:49:44
2 1278
今天完成的事
1打了一天的jar包(到最后才成功)(另外昨天war包的问题师兄帮助解决了)
2,敲dao层,及功能实现类代码,做Junit单元测试,(后用maven test测试异常)
明天计划的事
编写代码,在服务器上通过main方法跑流程
问题:
今天用maven test 跑 JDBC连接数据库出现异常(尚未弄明白)
D:\Users\Tom\eclipseworkspace\HelloMaven\src\main\java\StudentImpl.java使用了未经检查或不安全的操作。
后用尝试打jar包有如下异常:
这个是字符编码问题,百度一下就能找到(已解决)
没有主类(此问题耗费了一天的时间,复制了一天的配置文件没有用)
当然最后还是解决了(已经到第二天了)代码如下:
参考自:
http://doc.okbase.net/Josh_Persistence/archive/194576.html
代码如下:
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties> //以上一段是字符编码异常的解决办法
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>testJar.HelloMain</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
主函数输出 ----haha-----
(以上配置文件尚未滤清,明天继续研究)
收获:
总结:(今天占的坑不见了,感觉系统有bug)
评论