Skip to content

Instantly share code, notes, and snippets.

@yekki
Last active August 10, 2018 06:27
Show Gist options
  • Save yekki/8142d6a6e25714860a384306c1967efd to your computer and use it in GitHub Desktop.
Save yekki/8142d6a6e25714860a384306c1967efd to your computer and use it in GitHub Desktop.
WebLogic Server 12.2.1 Maven POM Sample
<?xml version="1.0" encoding="UTF-8"?>
<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>me.yekki</groupId>
<artifactId>mywebapp</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>basicWebapp</name>
<parent>
<groupId>com.oracle.weblogic.archetype</groupId>
<artifactId>wls-common</artifactId>
<version>12.2.1-1-0</version>
</parent>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<properties>
<oracleMiddlewareHome>/Users/gniu/Oracle/mw12c</oracleMiddlewareHome>
<oracleServerUrl>t3://localhost:7001</oracleServerUrl>
<oracleUsername>weblogic</oracleUsername>
<oraclePassword>welcome1</oraclePassword>
<oracleServerName>AdminServer</oracleServerName>
</properties>
<build>
<finalName>basicWebapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>12.2.1-1-0</version>
<configuration>
<middlewareHome>${oracleMiddlewareHome}</middlewareHome>
</configuration>
<executions>
<!--Deploy the application to the server-->
<execution>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<adminurl>${oracleServerUrl}</adminurl>
<user>${oracleUsername}</user>
<password>${oraclePassword}</password>
<source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source>
<targets>${oracleServerName}</targets>
<verbose>true</verbose>
<name>${project.build.finalName}</name>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>12.2.1-1-0</version>
<configuration>
<middlewareHome>${oracleMiddlewareHome}</middlewareHome>
</configuration>
<executions>
<!--Deploy the application to the server-->
<execution>
<id>weblogic-undeploy</id>
<phase>clean</phase>
<goals>
<goal>undeploy</goal>
</goals>
<configuration>
<adminurl>${oracleServerUrl}</adminurl>
<user>${oracleUsername}</user>
<password>${oraclePassword}</password>
<targets>${oracleServerName}</targets>
<verbose>true</verbose>
<name>${project.build.finalName}</name>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>absolute directory</id>
<url>file:////Users/gniu/.m2/repository</url>
</repository>
<snapshotRepository>
<id>localSnapshot</id>
<name>local snapshot repository</name>
<url>file:///Users/gniu/.m2/repository</url>
</snapshotRepository>
</distributionManagement>
</project>
@anuarora2812
Copy link

anuarora2812 commented Aug 10, 2018

Hi,

I am trying to build project with the above pom and getting below error and I am not able to find anything on google.

Failed to execute goal com.oracle.weblogic:weblogic-maven-plugin:12.2.1-2-0:deploy (default) on project basicwebapp: Execution default of goal com.oracle.weblogic:weblogic-maven-plugin:12.2.1-2-0:deploy failed: Plugin com.oracle.weblogic:weblogic-maven-plugin:12.2.1-2-0 or one of its dependencies could not be resolved: Failed to collect dependencies for com.oracle.weblogic:weblogic-maven-plugin:jar:12.2.1-2-0 (): No versions available for com.oracle.coherence:coherence:jar:[12.2.1,12.2.2) within specified range -> [Help 1]

Thanks in advance!!

Regards,
Anu Arora

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment