Today, I tried to use Maven with WebLogic 12c. The documentation for installation is straight forward. I was able to execute
mvn wls:help without any difficulty.
However, using the WebLogic plugin wasn’t as easy. In order to run commands such as
mvn wls:start-server, I needed to configure various parameters, such as
name. Instead of specifying these parameters every time I run the command, I added the following config to
<!-- WebLogic Server 12c Maven Plugin --> <plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>wls-maven-plugin</artifactId> <version>188.8.131.52</version> <configuration> <artifactLocation> com.oracle.weblogic:wls-dev:zip:184.108.40.206 </artifactLocation> <middlewareHome>/export/apps/wls</middlewareHome> <domainHome>/export/apps/wlsdomains/d1</domainHome> <user>weblogic</user> <password>welcome1</password> <name>applicationName</name> </configuration> </plugin>
After that, I was able to run the following commands without manually entering additional parameters. 🙂
mvn wls:start-server mvn wls:deploy mvn wls:list-apps mvn wls:undeploy mvn wls:stop-server
Initially, I noticed the following error when attempting to deploy/undeploy the web app. This appears to go away after I restarted the server.
[ERROR] Unknown lifecycle phase "applicationName". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException