2017-07-18 152 views
0

我想配置一個web應用程序使用tomee maven插件在https上運行,但它默認爲http。我如何指定必要的配置以使用https?如何配置tomee以通過https運行?

這是我做過什麼,到目前爲止:

<build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.openejb.maven</groupId> 
       <artifactId>tomee-maven-plugin</artifactId> 
       <version>1.7.1</version> 
       <configuration> 
        <tomeeVersion>1.7.1</tomeeVersion> 
        <tomeeClassifier>plus</tomeeClassifier> 
        <tomeeHttpsPort>8443</tomeeHttpsPort> 
        <context>${artifactId}</context> 
        <tomeeHost>testapp</tomeeHost> 
        <systemVariables> 
         <javax.net.ssl.keyStorePassword>changeit</javax.net.ssl.keyStorePassword> 
         <javax.net.ssl.keystoreFile>keystorePath</javax.net.ssl.keystoreFile> 
        </systemVariables> 
       </configuration> 

      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.6.1</version> 
       <configuration> 
        <source>1.8</source> 
        <target>1.8</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

回答

1

當我通過檢查插件的版本看,該功能默認使用HTTPS未實現。

你可以使用7.0.3版來代替:

<dependency> 
    <groupId>org.apache.tomee.maven</groupId> 
    <artifactId>tomee-maven-plugin</artifactId> 
    <version>7.0.3</version> 
</dependency> 

我不能完全肯定,如果是相同的插件,只是與其他的groupId,但github where the plugin is developed看起來很有希望。

正如this mailing-list所述,如果未設置http-port,插件將默認使用https。您也可以將forceHttps設置爲true以強制服務器使用https。

由於您在當前插件中使用的openejb-core版本,可能還有一些錯誤。如果您切換插件,則可能需要另一個openejb-core -version。

相關問題