Why are you using import rather than compile?

We built our own jars from the Spring jars so that we only had a single dependency that had a lot of jars that we needed. We actually when further and built a single Spring-Hibernate-MySql-Tomcat jar and made it "provided" so we only installed it once rather than accumulating all this stuff in each war file.

When we extended this to other third party tools (JasperReports, CXF, Faces,etc.), we got our war files down to a point where they only included our code and were a pleasure to build and deploy.

Ron

On 05/02/2013 9:37 AM, Matthew Adams wrote:
Nope.

Some products (like Spring or ORMs) modularize their offerings, but there
are common combinations of those modules that are nice to have for
convenient use.  For example, DataNucleus+JPA, DataNucleus+JDO+RDBMS, or
DataNucleus+JDO+Mongo.  See the various datanucleus-accessplatform-*
artifacts defined at
http://www.datanucleus.org/downloads/maven2/org/datanucleus/ for more
examples.

This is different from what I'm proposing.  It's one small additional step
beyond maven pom imports (see
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies).
The extra step is for maven to actually include the dependencies for me;
with current import support, I still have to add the imported dependencies
manually.

-matthew


David Pratt wrote
Isn't this exactly what transitive dependencies do?

--
David Pratt
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Tuesday, February 5, 2013 at 8:10 AM, Matthew Adams wrote:

Hi all,

I started using the pom import feature (
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies),
and discovered that it differed from my expectations. What I was looking
for was a way to define a new artifact in a pom that, if used in a
consuming artifact's
<dependencies>
, would include all of the dependencies
in the referenced artifact.

For example, take DataNucleus. I've defined my own pom for import
purposes
that contains both the
<dependencyManagement>
  section and
<dependencies>
that are to be included. It's at
https://github.com/matthewadams/datanucleus-rdbms/blob/master/pom.xml.

As a client, if I use the existing pom import support, then all I
effectively get are entries in my pom's
<dependencyManagement>
  section.
The inconvenient thing is, I still have to declare each of the imported
pom's dependencies that I want. That kind of defeats the purpose of
defining a pom to be imported, IMHO.

Instead, I'd like to propose that a new scope be introduced called
"include", that implies
<type>
pom
</type>
  so that all I have to do is use
the following in my consuming pom:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>


<project
xmlns="http://maven.apache.org/POM/4.0.0";

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>


<modelVersion>
4.0.0
</modelVersion>


<groupId>
me.matthewadams
</groupId>

<artifactId>
pom-include-client
</artifactId>

<version>
0.1.0.BUILD-SNAPSHOT
</version>

<packaging>
jar
</packaging>


<dependencies>


<dependency>

<groupId>
me.matthewadams
</groupId>

<artifactId>
datanucleus-rdbms
</artifactId>


<scope>
include
</scope>

<version>
3.1.4
</version>

</dependency>

</dependencies>

</project>
This way, it's extremely convenient to get all the constituent artifacts
without having to declare them all.

Thoughts?

-matthew

--
mailto:
matthew@
  &lt;
matthew@
  (mailto:
matthew@
)&gt;
skype:matthewadams12
googletalk:
matthew@
  (mailto:
matthew@
)
http://matthewadams.me
http://www.linkedin.com/in/matthewadams






--
View this message in context: 
http://maven.40175.n5.nabble.com/New-Maven-idea-include-import-tp5745916p5745923.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




--
Ron Wheeler
President
Artifact Software Inc
email: [email protected]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to