我的springboot应用程序构建成一个WAR文件(使用Jenkins)。我想要自动化到Websphere 9的远程部署。
我已经阅读过,似乎没有部署到websphere 9的maven插件,但是ant支持非常好。因此,我使用maven ant插件来帮助运行这些ant任务。我首先尝试列出安装的应用程序,看看它是否有效。然而,我遇到了一个与本地化相关的异常:
com.ibm.ws.profile.resourcebundle.WSProfileResourceBundle,错误C:\DEV\ant-was-apply.xml:81: java.util.MissingResourceException:无法找到基本名称
locale en_US的包
我的ant-was-ployy.xml来自pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>id123</id>
<phase>clean</phase>
<configuration>
<locales>es</locales>
<target>
<ant antfile="${basedir}/ant-was-deploy.xml">
<target name="listApps"/>
</ant>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>ant-was-ployy.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="websphere" default="listApps" basedir="." >
<target name="listApps" >
<taskdef name="wsListApps" classname="com.ibm.websphere.ant.tasks.ListApplications" classpath="${wasHome.dir}/plugins/com.ibm.ws.runtime.jar" />
<wsListApps
profileName="AppServ01"
wasHome="C:\\opt\\IBM\\WebSphere\\AppServer"
/>
</target>
</project>我认为错误来自于com.ibm.ws.runtime.jar。它里面有WSProfileResourceBundle.class和WSProfileResourceBundle_en.class,但没有WSProfileResourceBundle_en_US.class (名称只是一个假设--我在jar中复制了这个名称的包,但它没有工作)。
我还试图为整个插件设置区域设置,但这个插件的本地化似乎没有得到正确的实现(在我的情况下没有影响--我将地区设置为'es‘,但仍然得到了en_US的错误)。
我还试图将系统参数传递给maven命令: mvn洁净-Duser.language=fr -Duser.country=FR --它也不起作用。
那么,我的问题是,在ant脚本之前是否有一种方法可以更改区域设置?如果我可以将它设置为'en‘,它可能会找到正确的资源包。
我对Websphere相当陌生,如果有另一种解决方案来自动化到websphere 9的远程部署,我会很高兴听到的。我不想在目标服务器或Jenkins插件上使用脚本,但是如果没有其他方法.
发布于 2020-08-04 07:06:56
我只是遇到了同样的问题。在我的例子中,我在maven settings.xml中使用了一个不再存在的AppServer名称(AppSrv1而不是AppSrv01)。正确的服务器名称解决了这个问题。
https://stackoverflow.com/questions/62577444
复制相似问题