Maven and WebLogic 12c

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 middlewareHome, domainHOme, user, password, and name. Instead of specifying these parameters every time I run the command, I added the following config to pom.xml:

<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
    <groupId>com.oracle.weblogic</groupId>
    <artifactId>wls-maven-plugin</artifactId>
    <version>12.1.1.0</version>
    <configuration>
        <artifactLocation>
            com.oracle.weblogic:wls-dev:zip:12.1.1.0
        </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
Advertisement

4 thoughts on “Maven and WebLogic 12c

    1. I tried your solution but got this error:
      Cannot locate ‘modules\features’ folder under MW_HOME directory

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s