rogerio_gentil
rogerio_gentil

Reputation: 359

Automated deployment of EAR project without obtain dependencies from a repository

Is it possible deploy an artifact (.ear) into a application server (AS) without obtain its dependencies from a repository?

Let's me explain: the maven project I'm trying to configure for deploy into a AS has 3 modules:

  1. Web (.war - front end)
  2. EJB (.ejb - back end)
  3. Entity (.jar - entities classes)

These modules are wrapped into a EAR module and none of then are available in some repository (like Nexus or JFrog Artifactory). When I try to use Cargo Maven plugin or JBoss Deployment Maven Plugin, both notify that cannot resolve dependencies for these modules.


UPDATED (03/01/2019)

The issue is similar to that quoted in items 6 and 7 of the following link: http://webdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/html/ejb-basicex-eardeploy.html#ejb-basicex-eardeploy-testmodule

Upvotes: 0

Views: 245

Answers (1)

rogerio_gentil
rogerio_gentil

Reputation: 359

It's a workaround but worked. Instead of the project depends on an internal repository (like Nexus or JFrog Artifactory), it's possible defines a folder as a repository on the local machine using the Maven's parameter -Dmaven.repo.local. Thus, the plugin to deploy the artifact also can use this property and obtaining the others artifacts.

That is, to build the application on the current folder:

mvn -Dmaven.repo.local=. package

To deploy the application (.ear, in this case) using Cargo Maven Plugin, for example, without depending on an internal repository:

mvn -pl app-ear/ -Dmaven.repo.local=. cargo:redeploy

OBS: Using the maven.repo.local property, the folder defined as value will be fill with all dependencies of the project. In my case, it isn't a problem because this commands are been used on a continuous integration pipeline and all files and folder are discard on the final.

Upvotes: 0

Related Questions