Get your copy of the latest WebLogic (together with Coherence and OEPE) and install it. Download and configure Apache Maven 2.x.
Next is to configure the new plugins. Everything gets a lot simpler if you start with a blank domain. Start the configuration wizard and create one. Execute the user_projects\domains\base_domain\bin\setDomainEnv.cmd/.sh to prepare your environment. Now we can go on and configure the plugin jar file. This could be done with the WebLogic JarBuilder Tool (wljarbuilder) which ist located at
MW_HOME/wlserver_10.3/server/lib/change to that folder and execute:
java -jar wljarbuilder.jar -profile weblogic-maven-plugin. This will generate your barely 59 MB big
weblogic-maven-plugin.jar. Don't think about the weird output ;)
Open the jar file with your favorite ZIP tool and extract the META-INF\maven\com.oracle.weblogic\weblogic-maven-plugin\pom.xml to MW_HOME/wlserver_10.3/server/lib. If you look at the file you get the maven dependency information:
These fields identify the plug-in and mark a specific place in a Maven repository, acting like a coordinate system for Maven projects.
Now you have to install the plugin to your local maven repository. Execute:
mvn install:install-file -Dfile=weblogic-maven-plugin.jar -DpomFile=pom.xml
If you have never ever used Maven before, you should probably go and read other pages before but if you came here and you are wondering about what's happening after you executed this command for the first time ever: Maven is downloading the internet to your local repository and finally installs the generated jar file there, too.
Using the WebLogic Maven Plugin
You can use the plugin in two modes. First is from the cmd line. You can use the following goals: deploy, list-apps, redeploy,start-app,stop-app,undeploy,update-app.
If you followed my explanation you can simply type the following:
Or you can include the plugin in your own applications's pom.xml file:
You can add the plug-in into any life cycle phase of the project. Optionally, you can add a goal to any of the default Maven life cycle phases by adding an executions tag in the pom.xml file. The goal is then bound to that particular phase of the Maven life cycle. As shown above the goal is bound to the "install" phase of the life cycle. By doing this, every time you run the mvn install command, the deployment plug-in is also called.
Wondering about the long command?
The cmd line command is quite long. You can and should shorten the invocation name of the plugin. A couple of steps have to be taken to achieve this.
You have to change the pom.xml file and add:
After that modify the settings.xml file located in your $HOME/.m2 directory with the following lines:
before you provision the plug-in in your Maven repository.
After all this is done, you can call all commands with a shortened version:
Even if the documentation states, that the plugin should use Maven 2.x I tried everything with Maven 3 and did not discover any problems in general.
I will give it a test drive production near and will report further findings. At the moment everything looks very promising and simple. Thanks guys for providing this one!