It is possible to change the scope of a transitive dependency by defining
the artifact in dependencyManagement where you also specify the desired
scope.

/Anders

On Tue, Dec 18, 2018 at 5:08 AM Arnold Morein <[email protected]>
wrote:

> I have created a series of POM files:
>
> master-pom - contains all the various libraries, versions, scopes under
> the dependencyManagement section.
>
> Then I created webapp-pom - contains a subset of those libraries, specific
> to building web applications, also under the dependencyManagement  section.
>
> I then defined a specific EJB project (ee-cdi-webapp) based on webapp-pom
> that defines functionality desired in all applications. The dependencies
> are under dependencies section however. This project will become a required
> module in all EAR type projects.
>
> Then the main project is defined with ee-cdi-webapp as the the parent; it
> contains an EAR, EJB and WAR modules. The EAR, EJB, and WAR projects are
> building and deploying just fine.
>
> I then added a tiny dbutility project with a special class (and a main
> class to invoke it) to instantiate and therein test my Hibernate mappings,
> and initialize the database. This project has to be built into an
> executable jar.
>
> I then created an assembly project for the dbuility project so that only
> the desired persistence.xml file is included. It builds the executable jar
> just fine, but MOST of the resources from the dbuility project are all
> still in the PROVIDED scope.
>
> I do not understand how to forcibly change the scope of the inherited
> dependencies to COMPILE this far down stream.
>
> Can anyone offer any guidance?
>
>

Reply via email to