我试图为WAS Liberty服务器创建Maven项目。
mvn archetype:generate -DarchetypeGroupId = net.wasdev.wlp.maven -DarchetypeArtifactId = liberty-archetype-ear -DarchetypeVersion = 2.2 -DgroupId = com.test -DartifactId = test -Dversion = 1.0-SNAPSHOT
您能否告诉我如何配置上下文路径以及如何添加虚拟主机。
虽然原型模板没有专门提供配置这些的方法,但您可以轻松地从生成的应用程序和服务器配置开始,并从那里“正常”配置服务器。
mvn archetype:generate -DarchetypeGroupId=net.wasdev.wlp.maven -DarchetypeArtifactId=liberty-archetype-webapp -DarchetypeVersion=2.5 -DgroupId=com.test -DartifactId=test -Dversion=1.0-SNAPSHOT
<?xml version="1.0" encoding="UTF-8"?>
<web-bnd
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xmk/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-bnd_1_0.xsd"
version="1.0">
<virtual-host name="myVHost" />
</web-bnd>
<server description="Sample Servlet server">
<featureManager>
<feature>jsp-2.3</feature>
</featureManager>
<httpEndpoint host="*" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
<virtualHost id="myVHost">
<hostAlias>myDomain.myHost.com:9080</hostAlias>
</virtualHost>
<webApplication id="test" location="test.war" name="test" contextRoot="ctxRoot"/>
</server>
我注意到你特意询问了自由原型 - 耳朵原型,所以如果上述内容不能满足你的需求,请评论并提及。
此外,我将原型版本升级到2.5,这也引入了更新版本的Liberty(实际上是Open Liberty),尽管在2.2级别也应该没问题。
您可以