6

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

Stefan B.
  • 83
  • 8

1 Answers1

6

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>
Dennis Kriechel
  • 3,719
  • 14
  • 40
  • 62
  • If you purge your local repository each time you do an integration build to ensure reproducibility, this won't help you very much. Maybe, this is the motivation behind the oracle-maven-sync plugin? You need a weblogic installation around anyway, so why not do a sync:push before each build? – sschober Jul 30 '18 at 17:01