You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by MI...@fiberlink.com on 2005/09/30 18:20:37 UTC
Multi-artifact projects
Can anyone give me advice on handling multiple artifact projects?
Basically, scenarios like this:
.war file + .jar file (the jar file is an api, perhaps a web service)
.ear file + .war file
.jar file + .tld file
I'm using the maven 2.0 tasks from ant, and using ANT to build my
artifacts and calling the
<artifact:install> and <artifact:deploy> tasks to actually push them to
the local and remote
repositories.
---------------------
Matthew Inger
Fiberlink Communications Corp
215-664-1723
Re: Multi-artifact projects
Posted by Brett Porter <br...@gmail.com>.
On 10/4/05, MInger@fiberlink.com <MI...@fiberlink.com> wrote:
> What i'm really asking is there any effective way to do this with a single
> .pom file?
> If i use a single .pom file, and I set <packaging>jar</packaging> in it,
> when i try
> to use artifact:install to install the .war file, it automatically changes
> the suffix to .jar
> when it deploys.
For what you are doing, yes. As long as they represent the same
"thing" (ie one source tree, same identifier, just differing by
type/classifier), then you can produce multiple artifacts. You produce
one primary artifact (signified by packaging -> war), and then can
register plugins and profiles to produce extra artifacts that are
attached to the main artifact and deployed together. This is perfect
for tld's.
> Also, competing dep management products, such as ivy, do allow multiple
> artifacts
> to be specified in a single configuration file. that being said, i'd
> rather use maven's
> tasks if i can.
Ivy doesn't build things, so this is kind of irrelevant. Maven's
dependencies can obviously specify many dependencies themselves, not
just one.
> But having 3 pom files just to deploy a .jar, .war and
> .ear is a pain,
> especially for maintenence.
Why do you need to deploy a JAR, WAR and EAR that are basically the
same thing? I can understand wanting to make that easy, especially for
quick deployment for testing.
On the JAR -> WAR front, we encourage separate projects so your web
code is separate from your model (shared jar) code. Maven is about
making the best practices easy and the other things possible,
remember.
Hope this helps,
Brett
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Multi-artifact projects
Posted by MI...@fiberlink.com.
Let me add to this a little if i may.
Even with multiple .pom files, it's still not very easy to do multiple
artifacts.
If the only difference in my artifacts is the file type, I would hope i
could use
the same group and artifact id. However, that doesn't work because if i
first
publish the .jar file, and then the .war, the pom file from the war would
overwrite
the published pom file for the jar. It would be nice if there was
something like this
in the pom file:
<project>
<packaging>war</packaging>
<artifacts>
<artifact type="jar" />
<artifact type="tld" />
</artifacts>
</project>
At least this way, you could use the same pom file to publish both
artifacts. Their
names would be identical, except for the file extension. Ideally, i'd
like to name my
artifacts anything i want, but the biggest issue is when i want them to be
the same
(which is why multiple poms won't work)
---------------------
Matthew Inger
Fiberlink Communications Corp
215-664-1723
MInger@fiberlink.com
10/03/2005 10:31 AM
Please respond to
"Maven Users List" <us...@maven.apache.org>
To
"Maven Users List" <us...@maven.apache.org>
cc
Maven Users List <us...@maven.apache.org>
Subject
Re: Multi-artifact projects
What i'm really asking is there any effective way to do this with a single
.pom file?
If i use a single .pom file, and I set <packaging>jar</packaging> in it,
when i try
to use artifact:install to install the .war file, it automatically changes
the suffix to .jar
when it deploys.
Same would happen if i want to deploy a .tld file. I'm still miffed at
the inability of
a .pom file to handle multiple artifacts effectively. It's one of the
biggest issues I'd
had with maven 1.0.x, and for some reason 2.0 never addressed the problem
(at least not to my knowledge). To assume a build would only produce one
artifact
with a single type of packaging, IMHO is not a valid assumption.
Also, competing dep management products, such as ivy, do allow multiple
artifacts
to be specified in a single configuration file. that being said, i'd
rather use maven's
tasks if i can. But having 3 pom files just to deploy a .jar, .war and
.ear is a pain,
especially for maintenence.
---------------------
Matthew Inger
Fiberlink Communications Corp
215-664-1723
Brett Porter <br...@gmail.com>
09/30/2005 10:14 PM
Please respond to
"Maven Users List" <us...@maven.apache.org>
To
Maven Users List <us...@maven.apache.org>
cc
Subject
Re: Multi-artifact projects
I'm not entirely sure I know what you are asking, but I'd expect:
- create JAR file as usual
- install/deploy using tasks
- depend on jar file with a filesetId
- incorporate fileset in war at WEB-INF/lib with a flatten mapper
- install/deploy using tasks
is this what you needed to do?
- Brett
On 10/1/05, MInger@fiberlink.com <MI...@fiberlink.com> wrote:
> Can anyone give me advice on handling multiple artifact projects?
> Basically, scenarios like this:
>
> .war file + .jar file (the jar file is an api, perhaps a web service)
>
> .ear file + .war file
>
> .jar file + .tld file
>
> I'm using the maven 2.0 tasks from ant, and using ANT to build my
> artifacts and calling the
> <artifact:install> and <artifact:deploy> tasks to actually push them to
> the local and remote
> repositories.
>
> ---------------------
> Matthew Inger
> Fiberlink Communications Corp
> 215-664-1723
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Multi-artifact projects
Posted by MI...@fiberlink.com.
What i'm really asking is there any effective way to do this with a single
.pom file?
If i use a single .pom file, and I set <packaging>jar</packaging> in it,
when i try
to use artifact:install to install the .war file, it automatically changes
the suffix to .jar
when it deploys.
Same would happen if i want to deploy a .tld file. I'm still miffed at
the inability of
a .pom file to handle multiple artifacts effectively. It's one of the
biggest issues I'd
had with maven 1.0.x, and for some reason 2.0 never addressed the problem
(at least not to my knowledge). To assume a build would only produce one
artifact
with a single type of packaging, IMHO is not a valid assumption.
Also, competing dep management products, such as ivy, do allow multiple
artifacts
to be specified in a single configuration file. that being said, i'd
rather use maven's
tasks if i can. But having 3 pom files just to deploy a .jar, .war and
.ear is a pain,
especially for maintenence.
---------------------
Matthew Inger
Fiberlink Communications Corp
215-664-1723
Brett Porter <br...@gmail.com>
09/30/2005 10:14 PM
Please respond to
"Maven Users List" <us...@maven.apache.org>
To
Maven Users List <us...@maven.apache.org>
cc
Subject
Re: Multi-artifact projects
I'm not entirely sure I know what you are asking, but I'd expect:
- create JAR file as usual
- install/deploy using tasks
- depend on jar file with a filesetId
- incorporate fileset in war at WEB-INF/lib with a flatten mapper
- install/deploy using tasks
is this what you needed to do?
- Brett
On 10/1/05, MInger@fiberlink.com <MI...@fiberlink.com> wrote:
> Can anyone give me advice on handling multiple artifact projects?
> Basically, scenarios like this:
>
> .war file + .jar file (the jar file is an api, perhaps a web service)
>
> .ear file + .war file
>
> .jar file + .tld file
>
> I'm using the maven 2.0 tasks from ant, and using ANT to build my
> artifacts and calling the
> <artifact:install> and <artifact:deploy> tasks to actually push them to
> the local and remote
> repositories.
>
> ---------------------
> Matthew Inger
> Fiberlink Communications Corp
> 215-664-1723
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Multi-artifact projects
Posted by Brett Porter <br...@gmail.com>.
I'm not entirely sure I know what you are asking, but I'd expect:
- create JAR file as usual
- install/deploy using tasks
- depend on jar file with a filesetId
- incorporate fileset in war at WEB-INF/lib with a flatten mapper
- install/deploy using tasks
is this what you needed to do?
- Brett
On 10/1/05, MInger@fiberlink.com <MI...@fiberlink.com> wrote:
> Can anyone give me advice on handling multiple artifact projects?
> Basically, scenarios like this:
>
> .war file + .jar file (the jar file is an api, perhaps a web service)
>
> .ear file + .war file
>
> .jar file + .tld file
>
> I'm using the maven 2.0 tasks from ant, and using ANT to build my
> artifacts and calling the
> <artifact:install> and <artifact:deploy> tasks to actually push them to
> the local and remote
> repositories.
>
> ---------------------
> Matthew Inger
> Fiberlink Communications Corp
> 215-664-1723
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org