You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martijn Dashorst <ma...@gmail.com> on 2006/07/05 16:58:10 UTC

Assembly and parent pom

All,

If you have a project setup where all your projects have a common
parent project, and some are dependend on the others, how can you
accomodate the downloaders of your assemblies such that they still can
build your project using maven if/when they are offline?

Example setup:
<project>
<groupId>foo</groupId>
<artifactId>foo-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
</project>

<project>
<parent>
    <groupId>foo</groupId>
    <artifactId>foo-parent</artifactId>
    <version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bar</artifactId>
<packaging>jar</packaging>
</project>

The first problem is the parent pom. Is the snapshot version of the
parent pom updated when I build the bar project?

How should I construct my (source) assembly for bar, such that it can
be compiled using maven, even when the foo-parent pom is not available
on the central repo (usually the case for snapshot versions)? Add
(somehow) the foo-parent.pom to the assembly and provide README
instructions to perform an install first on the parent pom?

Martijn

-- 
Download Wicket 1.2 now! Write Ajax applications without touching JavaScript!
-- http://wicketframework.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Re: Assembly and parent pom

Posted by Martijn Dashorst <ma...@gmail.com>.
Barrie,

Thanks for the answers.

> > Example setup:
> > <project>
> > <groupId>foo</groupId>
> > <artifactId>foo-parent</artifactId>
> > <version>1.0-SNAPSHOT</version>
> > <packaging>pom</packaging>
> > </project>
> >
> > <project>
> > <parent>
> >     <groupId>foo</groupId>
> >     <artifactId>foo-parent</artifactId>
> >     <version>1.0-SNAPSHOT</version>
> > </parent>
> > <artifactId>bar</artifactId>
> > <packaging>jar</packaging>
> > </project>
> >
> > The first problem is the parent pom. Is the snapshot version of the
> > parent pom updated when I build the bar project?
>
> Maven does not build parent poms or dependencies on a project.
> You must either have access to a repository that the artifact can be
> downloaded from or manually run the mvn install command on each
> dependency so it is installed into your local repository.

What I meant to say is that snapshot dependencies are always checked
against the remote repository, but does this also work for the parent
reference?

i.e.
<dependency><groupId>foo</groupId><artifactId>foo</artifactId><version>SNAPSHOT</version></dependency>

in the bar project will update the dependency foo.foo-SNAPSHOT.jar on
every build.

Does the parent pom also get updated everytime the bar project gets built?

Martijn

-- 
Download Wicket 1.2 now! Write Ajax applications without touching JavaScript!
-- http://wicketframework.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Assembly and parent pom

Posted by Barrie Treloar <ba...@gmail.com>.
On 7/6/06, Martijn Dashorst <ma...@gmail.com> wrote:
> All,
>
> If you have a project setup where all your projects have a common
> parent project, and some are dependend on the others, how can you
> accomodate the downloaders of your assemblies such that they still can
> build your project using maven if/when they are offline?

I've never used offline mode, but if everything is in your local
repository it should be available for a build in offline mode.

>
> Example setup:
> <project>
> <groupId>foo</groupId>
> <artifactId>foo-parent</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>pom</packaging>
> </project>
>
> <project>
> <parent>
>     <groupId>foo</groupId>
>     <artifactId>foo-parent</artifactId>
>     <version>1.0-SNAPSHOT</version>
> </parent>
> <artifactId>bar</artifactId>
> <packaging>jar</packaging>
> </project>
>
> The first problem is the parent pom. Is the snapshot version of the
> parent pom updated when I build the bar project?

Maven does not build parent poms or dependencies on a project.
You must either have access to a repository that the artifact can be
downloaded from or manually run the mvn install command on each
dependency so it is installed into your local repository.

If your parent pom has <modules> defined then you can run mvn install
at the parent level and the modules will automatically get built as
well.

> How should I construct my (source) assembly for bar, such that it can
> be compiled using maven, even when the foo-parent pom is not available
> on the central repo (usually the case for snapshot versions)? Add
> (somehow) the foo-parent.pom to the assembly and provide README
> instructions to perform an install first on the parent pom?

Your source should be compilable because your parent pom and other
dependencies are already in your local repository.

If they are not in the local repository then, as above, you either
need to make them available from a remote repository or you need to
have manually installed them into your local repository.

HTH

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org