server.bat start MyServer
Since even command prompt has failed, it will be the same in MAVEN. Anyhow that only happened on Windows. Only Windows will always cause trouble to me! Now my objective is to configuration MAVEN goal like this > clean install liberty:start-server. To achieve this, some workaround is needed.
1. First thing to do is to declare a repository for Liberty Profile in pom.xml as shown below:
2. Then declare a start-server goal as shown below:WASdev WASdev Repository http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/ default false true
3. Open the server.xml which I have specified during the step 2 of the MAVEN configuration, add/replace the following code.com.ibm.websphere.wlp.maven.plugins liberty-maven-plugin 1.0 /home/kokhoe/tool/wlp MyInstance ... ... start-server pre-integration-test start-server 200 /home/kokhoe/tool/wlp/usr/servers/MyInstance/server.xml
*NOTE: The default value of location attribute is without the full path and version number.
To determine the location attribute, this is how I do it. At the beginning of MAVEN configuration, I have this:
That is for MAVEN allocate my web application in repository. With this information, I know that during the install stage life cycle, my application will be installed into following location:org.huahsin WebProject 0.0.1-SNAPSHOT war
/home/kokhoe/.m2/repository/org/huahsin/WebProject/0.0.1-SNAPSHOT/
By now when MAVEN build is trigger, it will automatically package and deploy, and the server is ready to listening incoming request.