maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitriy (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (MRELEASE-543) prepare-with-pom : inherited dependencies exclusion are lost in release-pom.xml
Date Fri, 08 Apr 2016 17:39:25 GMT

    [ https://issues.apache.org/jira/browse/MRELEASE-543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15230381#comment-15230381
] 

Dmitriy edited comment on MRELEASE-543 at 4/8/16 5:38 PM:
----------------------------------------------------------

The issue is still present in v2.5.3 of the plugin. Preparing release-pom and later building
with release-pom leads to failed build due to exclusions from the original pom not being ported
somehow to the release-pom. [~sergei_ivanov@mail.ru]'s suggestion should resolve it.

As an ugly workaround, the following can be added to pom.xml to add exclusions to release-pom.xml
after it's generated:
{code}
			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<version>1.5.2</version>
				<executions>
					<execution>
						<phase>prepare-package</phase>
						<goals>
							<goal>replace</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<basedir>./</basedir>
					<includes>
						<include>release-pom.xml</include>
					</includes>
					<replacements>
						<replacement>
							<!-- To remove all transient dependencies -->
							<token>&lt;dependency&gt;</token>
							<value>&lt;dependency&gt;&lt;exclusions&gt;&lt;exclusion&gt;&lt;artifactId&gt;*&lt;/artifactId&gt;&lt;groupId&gt;*&lt;/groupId&gt;&lt;/exclusion&gt;&lt;/exclusions&gt;</value>
						</replacement>
					</replacements>
				</configuration>
			</plugin>
{code}


was (Author: dimath):
The issue is still present in v2.5.3 of the plugin. Preparing release-pom and later building
with release-pom leads to failed build due to exclusions from the original pom not being ported
somehow to the release-pom. [~sergei_ivanov@mail.ru]'s suggestion should resolve it.

As an ugly workaround, the following can be added to pom.xml to add exclusions to release-pom.xml
after it's generated:
{code}
			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<version>1.5.2</version>
				<executions>
					<execution>
						<phase>prepare-package</phase>
						<goals>
							<goal>replace</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<basedir>./</basedir>
					<includes>
						<include>release-pom.xml</include>
					</includes>
					<replacements>
						<replacement>
							<!-- To eliminate excluded in pom.xml dependencies from release-pom.xml -->
							<token>&lt;dependency&gt;</token>
							<value>&lt;dependency&gt;&lt;exclusions&gt;&lt;exclusion&gt;&lt;artifactId&gt;*&lt;/artifactId&gt;&lt;groupId&gt;*&lt;/groupId&gt;&lt;/exclusion&gt;&lt;/exclusions&gt;</value>
						</replacement>
					</replacements>
				</configuration>
			</plugin>
{code}

> prepare-with-pom : inherited dependencies exclusion are lost in release-pom.xml
> -------------------------------------------------------------------------------
>
>                 Key: MRELEASE-543
>                 URL: https://issues.apache.org/jira/browse/MRELEASE-543
>             Project: Maven Release Plugin
>          Issue Type: Bug
>          Components: prepare-with-pom
>    Affects Versions: 2.0
>         Environment: Maven 2.2.1
>            Reporter: Thomas Sauzedde
>         Attachments: sample-projects.tgz
>
>
> Like in the provided sample projects, I have the following scenario : 3 modules (sibling)
with the following inheritage graph :
> grandfather  <=== father <=== child
> - grandfather (pom module) has
>     - a dependencyManagement block with some exclusions
>     - a pluginManagement block
> - father (pom module) adds a plugins block to configure the compiler plugin
> - child is a basic (empty) jar module
> when mvn release:prepare-with-pom is performed on "child" the checked-in (svn) release-pom.xml
has all the dependencies resolved BUT my exclusions defined in "grandfather" are lost :-(
> To reproduce this with the provided sample projects : 
> - perform a mvn:install on grandfather & father
> - import "child" in your svn repo
> - change the scm block on "child" in order to checkout/in from your svn
> - perform a mvn release:prepare-with-pom
> You will see that in your tagged release-pom.xml the exclusions are lost.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message