`
tanbamboo
  • 浏览: 19500 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Maven插件maven-resources-plugin在copy-resources的时候的Bug

阅读更多
最近一个应用用到了Jetty SSL方式,开发的时候把测试用的keystore文件放到conf目录下,
然后mvn package进行打包,可是运行的时候发现始终报错:
java.io.IOException: Invalid keystore format
	at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:633)
	at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
	at java.security.KeyStore.load(KeyStore.java:1185)
	at org.mortbay.jetty.security.SslSocketConnector.createFactory(SslSocketConnector.java:215)
	at org.mortbay.jetty.security.SslSocketConnector.newServerSocket(SslSocketConnector.java:423)
	at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
	at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
	at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.Server.doStart(Server.java:235)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)



通过比较原始的keystore文件和打包后的keystore文件,发现文件大小已经改变了。
看来是maven-resources-plugin在copy-resources的时候的改动的,可能会编码设定有关系。
暂时还没有找到解决方法,Mark一下先。
分享到:
评论
3 楼 tanbamboo 2010-01-21  
谢谢,有空再试试看。
2 楼 vipmail 2010-01-20  
<encoding>base64</encoding> 这个最关键
1 楼 vipmail 2010-01-20  
<build>
  <resources>
    <resource>
    <filtering>false</filtering>
    <directory>src/main/resources</directory>
    <includes>
    <include>**/*.properties</include>
    <include>**/*.xml</include>
    </includes>
    </resource>
    </resources>
  <plugins>
  <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.3</version>
            <executions>
            <execution>
            <id>copy-resources</id>
            <phase>process-resources</phase>
            <goals>
            <goal>copy-resources</goal>
            </goals>
            <configuration>
                    <outputDirectory>${project.build.directory}/classes</outputDirectory>
                    <encoding>base64</encoding>
                        <resources>
                        <resource>
                        <directory>src/main/resources</directory>
                            <excludes>
                            <exclude>**/*.properties</exclude>
                            <exclude>**/*.xml</exclude>
                            </excludes>
                        </resource>
                        </resources>
                    </configuration>
            </execution>
            </executions>
        </plugin>
  </plugins>
  </build>

相关推荐

Global site tag (gtag.js) - Google Analytics