maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Broyer <t.bro...@gmail.com>
Subject Re: Best practices for Java EE 7 dependencies
Date Fri, 07 Feb 2014 17:03:44 GMT
Because javax:javaee-api:7.0 doesn't use dependencyManagement, but declares
straight dependencies, I don't think <scope>import</scope> would work (or
be appropriate); however you should be able to declare javax:javaee-api:1.0
as a managed dependency (in <dependencyManagement>, but without any
specific scope, i.e. <scope>compile</scope> as it's the default) and then
declare needed dependencies; I'm not sure that'd work either though. So I
think the only real choice is to add it as a dependency, with
<scope>provided</scope>; you'll have all the JARs in the classpath at build
time, but only at build time.


On Fri, Feb 7, 2014 at 11:56 AM, Samuli Saarinen <samuli.saarinen@remion.com
> wrote:

> Hi,
>
> You could import the dependencies  in dependencyManagement as described in
> [1] and only declare needed dependencies in the project.
>
> Cheers
>
> Samuli
>
> [1]
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies
>
> -----Original Message-----
> From: Martin Hoeller [mailto:martin@xss.co.at]
> Sent: 7. helmikuuta 2014 11:33
> To: Maven Users List
> Subject: Best practices for Java EE 7 dependencies
>
> Hi!
>
> I'm wondering what the best practices are for specifying Java EE 7
> dependencies in my modules.
>
> There is the so called BOM (bill of materials) POM: javax:javaee-api:7.0
> which lists all API submodules required for JEE7. Specifying this in my
> module as
>
>   <dependency>
>     <groupId>javax</groupId>
>     <artifactId>javaee-api</artifactId>
>     <version>7.0</version>
>   </dependency>
>
> works and is the least work for me. However, this way I got all JEE APIs
> on the CLASSPATH even if I just need a few of them. Further on, the
> actual dependencies are now transitive which is (IMHO) not fully correct.
> Should I better specify the exact dependencies and investigate some more
> work in POM maintainance? What would this gain me?
>
> What do you think?
>
> - martin
>



-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message