Skip to content

Instantly share code, notes, and snippets.

@dhval
Last active June 6, 2022 04:37
Show Gist options
  • Save dhval/9959440 to your computer and use it in GitHub Desktop.
Save dhval/9959440 to your computer and use it in GitHub Desktop.
Using Weblogic maven plugin to deploy artifacts.

Using local instance of WLS 12c in order to speed up development and hot deploy code on the fly.

..* Download free developer edition of Weblogic 12c [wls1211_dev.zip] (http://www.oracle.com/technetwork/middleware/fusion-middleware/downloads/index.html)

..* Install Oracle Enterprise Pack for Eclipse using [eclipse market] (http://download.oracle.com/otn_software/oepe/kepler) place preferably

..*Install it through command line.

wls:install -DartifactLocation=~/java/wls1211_dev.zip && cd wls1220 && ./configure.sh

It would ask for usr name and password during installation.

To hot deploy in eclipse

In Eclipse>Servers>Webl ogic>Publishing>

Check these options

  1. Publish as an exploded archive
  2. Enable automatic publish when file changes.
## generic files to ignore
*.DS_Store
local/
build/
mvn wls:deploy -Dupload=true -Ddebug=true -Dremote=true -Dstage=true\
-Dadminurl=t3://10.1.226.44:7001 \
-Dtargets=InquiryCluster \
-Dsource=photosearch2.war \
-Dfile=photosearch2.war \
-Dname=photosearch2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jnet.weblogic</groupId>
<artifactId>weblogic-pom</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<description>Weblogic deployment</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- WS-Axis Dev ALT Port -->
<ws.axis.url>http://10.1.26.48:51004/PennDOT/Driver</ws.axis.url>
<!-- WS-Axis Dev with DNS ALT Port <ws.axis.url>http://internalws.apps:41004/PennDOT/Driver</ws.axis.url> -->
<!-- Weblogic 10/12c deployment -->
<wls.name>driverinfo</wls.name>
<war.file>target/driverinfo.war</war.file>
<wls.url>t3://10.1.226.44:7001</wls.url>
<wls.target>PennDOTCluster</wls.target>
<wls.user>wldeploy</wls.user>
<wls.password>Weblogic12c</wls.password>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.3</version>
<configuration>
<goalPrefix>weblogic</goalPrefix>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<warName>${wls.name}.war</warName>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<archive>
<manifest>
<classpathPrefix>WEB-INF/lib/</classpathPrefix>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<!-- WebLogic Server 10 Maven Plugin -->
<plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>12.1.1.0</version>
<configuration>
<!-- <middlewareHome>\\10.1.226.44\e$\Oracle</middlewareHome> <weblogicHome>\\10.1.226.44\e$\Oracle\wlserver</weblogicHome> -->
<adminurl>${wls.url}</adminurl>
<user>${wls.user}</user>
<password>${wls.password}</password>
<debug>true</debug>
<name>${wls.name}</name>
<remote>true</remote>
<upload>true</upload>
<failOnError>true</failOnError>
<source>${war.file}</source>
<targets>${wls.target}</targets>
</configuration>
<executions>
<execution>
<id>deploy</id>
<phase>package</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<source>${war.file}</source>
</configuration>
</execution>
</executions>
</plugin>
<!-- 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 -->
/Users/Dhval/dhval/weblogic12/wls1211_dev.zip
</artifactLocation>
<middlewareHome>/Users/Dhval/dhval/weblogic12/wls</middlewareHome>
<domainHome>/Users/Dhval/dhval/weblogic12/wlsdomain</domainHome>
<adminurl>${wls.url}</adminurl>
<user>${wls.user}</user>
<password>${wls.password}</password>
<remote>true</remote>
<debug>true</debug>
<!-- <name>${wls.name}</name> -->
</configuration>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>plugins-release</id>
<url>${plugins-release.url}</url>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://oa5tppjnet200:8081/artifactory/libs-snapshot-local</url>
</snapshotRepository>
<repository>
<id>central1</id>
<name>libs-release</name>
<url>http://oa5tppjnet200:8081/artifactory/libs-release-local</url>
</repository>
</distributionManagement>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment