要獲得碼頭9.2.13運行.v20150730在使用DIY墨盒的Openshift上,您必須使用Java8將其設置爲在$OPENSHIFT_INTERNAL_IP
上運行,如下所示。首先SSH到主機並下載jdk8與
cd $OPENSHIFT_DATA_DIR
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz
tar -zxf jdk-8u5-linux-x64.tar.gz
export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0_05/bin:$PATH
export JAVA_HOME="$OPENSHIFT_DATA_DIR/jdk/jdk1.8.0_05"
java -version
然後在你的.openshift\action_hooks\start
確保您有類似相同的輸出變量:
# see http://stackoverflow.com/a/23895161/329496 to install jdk1.8 no DIY cartridge
export JAVA_HOME="$OPENSHIFT_DATA_DIR/jdk/jdk1.8.0_05"
export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0_05/bin:$PATH
nohup java -cp ${OPENSHIFT_REPO_DIR}target/dependency/jetty-runner.jar org.eclipse.jetty.runner.Runner --host ${OPENSHIFT_DIY_IP} --port ${OPENSHIFT_DIY_PORT} ${OPENSHIFT_REPO_DIR}/target/thinbus-srp-spring-demo.war > ${OPENSHIFT_LOG_DIR}server.log 2>&1 &
(請注意,jdk-8u20-linux-x64.tar.gz
也已上報工作,以便您可能想要查看最新版本。)
該設置不需要jetty.xml
,因爲它將--host
和--port
設置爲綁定到正確的接口並運行buil t戰爭文件。它所要求的是將jetty-runner.jar從常春藤緩存中複製到目標文件夾中。與Maven這樣做,你加入類似:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-runner</artifactId>
<version>${jetty.version}</version>
<destFileName>jetty-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
谷歌表明,SBT相當於簡直是retrieveManaged := true
。您可以ssh到主機並運行find
來確定jetty-runner.jar
依賴項已被複制到哪裏,並適當更新啓動命令。
您可以分享您的openshift定製嗎? – Salil 2013-05-12 11:10:39