I found a way to do this, though ideal would be to have some flag in the
child pom.xml, that could tell maven to install and deploy the parent as
well. My parent pom is ${basedir}/build/pom.xml
This is what I added to my child pom.xml
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>install_parent</id>
<goals>
<goal>run</goal>
</goals>
<phase>install</phase>
<inherited>false</inherited>
<configuration>
<tasks>
<path id="maven-ant-tasks.classpath"
path="${settings.localRepository}/org/apache/maven/maven-artifact-ant/2.0.4/maven-ant-tasks-2.0.4.jar"
/>
<typedef
resource="org/apache/maven/artifact/ant/antlib.xml"
classpathref="maven-ant-tasks.classpath" />
<pom id="parent.project"
file="build/pom.xml" />
<install>
<pom refid="parent.project" />
</install>
</tasks>
</configuration>
</execution>
<execution>
<id>deploy_parent</id>
<goals>
<goal>run</goal>
</goals>
<phase>deploy</phase>
<inherited>false</inherited>
<configuration>
<tasks>
<path id="maven-ant-tasks.classpath"
path="${settings.localRepository}/org/apache/maven/maven-artifact-ant/${maven-artifact-ant.version}/maven-ant-tasks-${maven-artifact-ant.version}.jar"
/>
<typedef
resource="org/apache/maven/artifact/ant/antlib.xml"
classpathref="maven-ant-tasks.classpath" />
<pom id="parent.project"
file="build/pom.xml" />
<deploy>
<remoteRepository
url="${project.distributionManagement.repository.url}"/>
<remoteSnapshotRepository
url="${project.distributionManagement.snapshotRepository.url}"/>
<pom refid="parent.project" />
</deploy>
</tasks>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-ant</artifactId>
<version>${maven-artifact-ant.version}</version>
</dependency>
</dependencies>
</plugin>
Wayne Fay wrote:
>
> No, you must "cd to the directory of base pom and run mvn deploy
> again". Or if you have things configured with <modules> etc, you
> should be able to run "mvn deploy" from only the parent directory, and
> it should build and deploy the parent and all modules with one
> command.
>
> Wayne
>
> On 7/24/07, kapilanand <[EMAIL PROTECTED]> wrote:
>>
>> hi
>> I have one base pom.xml that is inherited by another pom.
>> The child pom declares the relative path of the parent pom and so maven
>> in
>> not required to pull this parent pom from the repository, when the child
>> project is built.
>> Child pom does not even define its own version and inherits it from
>> parent
>> pom, but this child is not a module of the parent, i.e. there is no
>> aggregation relation.
>>
>> What I want to achieve is that when I run "mvn deploy" for the child
>> project, it should also deploy the parent pom appropriately. Without this
>> base pom in repository other projects cannot use or depend on this child
>> project. Only option known to me now is to cd to the directory of base
>> pom
>> and run mvn deploy again.
>>
>> Is there some pom file setting or command line option to achieve this?
>>
>> thanks
>> kapil
>> --
>> View this message in context:
>> http://www.nabble.com/how-to-auto-deploy-parent-pom-along-with-the-inherited-pom-tf4137139s177.html#a11766952
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/how-to-auto-deploy-parent-pom-along-with-the-inherited-pom-tf4137139s177.html#a11782727
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]