使用War包在weblogic发布时,在选择定位样式(targeting style)步骤,一般情况下都是默认选中"将此部署安装为应用程序",但最近在使用springboot产生的war包发布时,weblogic的默认选项是“”将此部署安装为库”,每次发布时都要改为安装为应用程序。
经过排除后,发现是WAR包META-INF目录的MANIFEST.MF文件的属性影响的。
该配置文件里,有一项属性 Implementation-Version ,这个会造成weblogic 默认部署安装为库。把这项属性移除后默认选中部署安装为应用程序。
MANIFEST.MF是maven在install 的时候产生并添加属性,为避免每次都手动修改,可在pom中增加以下的属性,让maven不产生Implementation-Version属性。
修改pom.xml,在plugin中增加manifest节点并设置属性为false
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>false</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>