Wls-maven-plugin: shared library deployment

I am migrating from weblogic-maven-plugin (10.3) to wls-maven-plugin (12.1) and have encountered a problem deploying the shared library.

The problem is that wls-maven-plugin does not go to the Weblogic.Deployer library checkbox. For weblogic-maven-plugin I have the same conf:

<plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>weblogic-maven-plugin</artifactId> <version>10.3.6.0</version> <configuration> <adminurl>t3://localhost:7001</adminurl> <user>${weblogic.username}</user> <password>${weblogic.password}</password> <upload>true</upload> <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source> <name>${project.build.finalName}</name> <isLibrary>true</isLibrary> </configuration> </plugin> 

The isLibrary element shows the -library pass plugin that calls Weblogic.Deployer.

After switching to the wls plugin:

 <plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>wls-maven-plugin</artifactId> <version>12.1.1.0</version> <configuration> <adminurl>t3://localhost:7001</adminurl> <user>${weblogic.username}</user> <password>${weblogic.password}</password> <middlewareHome>${env.MW_HOME}</middlewareHome> <upload>false</upload> <action>deploy</action> <remote>false</remote> <isLibrary>true</isLibrary> <verbose>true</verbose> <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source> <name>${project.build.finalName}</name> </configuration> </plugin> 

But the wls plugin does not pass the -library flag to Weblogic.Deployer and as a result the jar is deployed with an unknown type, so my applications cannot use the library because they could not find it.

Note. If I do a manual deployment using Weblogic.Deployer, everything works fine, so my manifest and weblogic-application.xml files should be correct.

+4
source share
4 answers

The workaround is wls: wlst. Calling your own wlst script (it should be written by itself - it is simple) and passing parameters from maven to such a deployment source, url, user / password (using the WLST command that we can pass is a library parameter). It works well, but it looks bad from my point of view. In addition, I think that this can be done using the ant task and call weblogic.deployer (in any case, maven plugin and wlst call weblogic deployer application are just wrappers).

0
source

The following are the steps to be taken:

  • identify the file and jar oracle-maven-sync pom. Edit the pom file in your version of maven. Install them: mvn -e install: install-file -DpomFile = oracle-maven-sync.12.1.2.pom -Dfile = oracle-maven-sync.12.1.2.jar

  • add the following dependencies to your repository: JDOM-1,1 Maven-artifact Maven-Compat Maven-plugin-api Common codec-1.6 Common-2.2

  • Create a folder on your local computer on which the following Weblogic dependencies will be installed:

  weblogic_dependencies
                      |
                      --wlserver
                                |
                                --server
                                        |
                                        --lib
                                             - weblogic.jar
                      |
                      --modules

(copy the wlserver / server / lib / weblogic.jar file and all the files under the wlserver / modules folder from the web library). Set MW_HOME to specify the weblogic_dependencies folder.

  • Run the following command from the computer on which Weblogic is installed: mvn -e -X -U com.oracle.maven: oracle-maven-sync: push -DserverId = archiva_repository_id_from_maven_config_xml -Doracle-maven-sync.oracleHome =% MW_HOME%

  • mvn -U archetype: crawl -Dcatalog = c: .m2 \ archetype-catalog.xml

  • deploy wls-maven-plugin in your artifact repository (see Oracle documentation for this !).

    • Remote deployment without middlewareHome parameter (may not work):

      mvn clean package com.oracle.weblogic: wls-maven-plugin: deploy -Dadminurl = t3: // admin_server_ip: 7001 -Duser = weblogic_user -Dpassword = weblogic_pass -Dtargets = SRV_7011 -Dupload = true -Dname = maven_project_id

    • Remote deployment using the -DmiddlewareHome =% MW_HOME% parameter:

      mvn clean package com.oracle.weblogic: wls-maven-plugin: deploy -Dadminurl = t3: // admin_server_ip: 7001 -Duser = weblogic_user -Dpassword = weblogic_pass -Dtargets = SRV_7011 -Dupload = true -Dname = maven_project_id - Dver -DmiddlewareHome =% MW_HOME%

0
source

there is no true isLibrary tag in the maven plugin for library deployment

0
source

IMHO it is easier than the answers provided.

Having carefully studied the Oracle documentation page, you will see that there is a library of configuration parameters that says: Deploy as a Java EE shared library or an optional package.

This parameter also needs the artifactLocation option.

The code below runs smoothly and deploys the CommonLibs module as a library:

 <build> <finalName>CommonLibs</finalName> <plugins> <plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>weblogic-maven-plugin</artifactId> <version>12.2.1.3</version> <configuration> <user>USER_NAME</user> <password>PASS_WORD</password> <name>${project.build.finalName}</name> <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source> <artifactLocation>${project.build.directory}/${project.build.finalName}.${project.packaging}</artifactLocation> <library>true</library> </configuration> <executions> <execution> <id>up</id> <phase>pre-integration-test</phase> <goals> <goal>deploy</goal> </goals> </execution> </executions> </plugin> </plugins> </build> 
0
source

Source: https://habr.com/ru/post/1483184/


All Articles