繁体   English   中英

Dropwizard项目的Maven执行无法正常工作

[英]Maven exec for Dropwizard project was not working

我尝试构建一个Dropwizard应用程序,当我尝试使用mvn exec:java来执行它(包括

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.6.0</version>
        <configuration>
            <mainClass>${mainClass}</mainClass> //the application java class from properties tag 
            <arguments>
                <argument>server</argument>
            </arguments>
      </configuration>
</plugin>

在使用mvn命令> mvn exec:java时,在命令提示符中显示它会构建并部署它,相反出现以下问题

[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ hello-dropwizard ---
[WARNING]
java.lang.ArrayIndexOutOfBoundsException: 1
        at org.hibernate.validator.internal.util.Version.getJavaRelease(Version.java:36)
        at org.hibernate.validator.internal.engine.ConfigurationImpl.<init>(ConfigurationImpl.java:120)
        at org.hibernate.validator.internal.engine.ConfigurationImpl.<init>(ConfigurationImpl.java:106)
        at org.hibernate.validator.HibernateValidator.createSpecializedConfiguration(HibernateValidator.java:27)
        at org.hibernate.validator.HibernateValidator.createSpecializedConfiguration(HibernateValidator.java:24)
        at javax.validation.Validation$ProviderSpecificBootstrapImpl.configure(Validation.java:220)
        at io.dropwizard.validation.BaseValidator.newConfiguration(BaseValidator.java:28)
        at io.dropwizard.jersey.validation.Validators.newConfiguration(Validators.java:35)
        at io.dropwizard.jersey.validation.Validators.newValidatorFactory(Validators.java:27)
        at io.dropwizard.setup.Bootstrap.<init>(Bootstrap.java:68)
        at io.dropwizard.Application.run(Application.java:72)
        at com.dropwizard.demo.HeloDropWizardApplication.main

这种行为有什么原因吗?

注意到我在系统中安装了Java 9,对休眠验证器类的研究很少,它期望返回8,因为我没有以特定的方式返回9,因为下面的代码

String[] specificationVersion = System.getProperty( "java.specification.version" ).split( "\\." );
return Integer.parseInt( specificationVersion[1] );

我更改了PATH以包括Java 1.8路径,即使Maven抛出了相同的异常。 我必须使用> mvn package然后使用> java -jar target\\dropwizarddemo.jar server

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM