Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebLogic Maven Plugin has too many dependencies?

I'm using the weblogic maven plugin to deploy my app on the server.

I'm not sure if I've done a mistake at the configuration. The first maven build of the day takes a long time (~30 minutes) because the plugin seems to have a huge amount of dependencies to the complete weblogic stack and updates the maven-metadata.xml files.

My configuration looks like this:

<plugin>
  <groupId>com.oracle.weblogic</groupId>
  <artifactId>weblogic-maven-plugin</artifactId>
  <version>12.1.3-0-0</version>
  <configuration>
    <adminurl>t3://localhost:7001</adminurl>
    <user>admin</user>
    <password>pass</password>
    <upload>true</upload>
    <action>deploy</action>
    <remote>false</remote>
    <verbose>true</verbose>
 <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source>
    <name>${project.build.finalName}</name>
    <targets>myserver</targets>
  </configuration>
</plugin>

Maybe our Nexus-repo is too slow. ;-)

Thanks in advance

like image 904
Stefan B. Avatar asked Oct 29 '15 07:10

Stefan B.


People also ask

What is WebLogic Maven plugin?

The weblogic-maven-plugin provides enhanced functionality to install, start and stop servers, create domains, execute WLST scripts, and compile and deploy applications. With the weblogic-maven-plugin , you can install WebLogic Server from within your Maven environment to fulfill the local WebLogic Server requirement.

How to configure Maven plugin in POM xml?

Next, open the command console and go to the folder containing pom. xml and execute the following mvn command. Maven will start processing and displaying the clean phase of clean life cycle. Plugins are specified in pom.

What are the correct types of Maven plugins?

Introduction. In Maven, there are two kinds of plugins, build and reporting: Build plugins are executed during the build and configured in the <build/> element. Reporting plugins are executed during the site generation and configured in the <reporting/> element.

How Maven plugin works?

Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects. They do this by executing an "action" (i.e. creating a WAR file or compiling unit tests) in the context of a project's description - the Project Object Model (POM).


1 Answers

I found the problem and hopefully some good sollutions:

Note: I'm not using Nexus-Repo but Artifactory (but I guess Maven behaves the same on both).

The Problem occours due to a missconfiguration of our repository. Maven will always check for an update (by default) if your libraries are located in a snapshot-repository (defined in your settings.xml).

In my case a virtual repository for snapshots contained the Oracle libraries which caused Maven to treat them as snapshots.

There are some ways to avoid this:

  1. If you are not able to change your Settings:

Use the parameter "no-snapshot-updates" when executing a maven goal:

mvn goal --no-snapshot-updates
  1. Change Your settings.xml

Add the following to the repositories where your Oracle libraries are located:

<repository>
    <id>my-oracle-repo</id>
    <url>http://someurl</url>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
</repository>
  1. Move your Oracle libraries away from the snapshot repository.

EDIT: It seems like its not only related to the snapshots but also to the "updatePolicy" which is by default set to "daily". Change your maven settings.xml as follows:

<repository>
    <id>my-oracle-repo</id>
    <url>http://someurl</url>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
    <releases>
        <updatePolicy>never</updatePolicy>
    </releases>
</repository>
like image 60
Dennis Kriechel Avatar answered Oct 26 '22 05:10

Dennis Kriechel