Typo! I mean "default plugin version 2.5". Alexander Kriegisch schrieb am 28.10.2020 08:22 (GMT +07:00):
> Thanks Roy, > > I noticed that the actual build lifecycle (goals like validate, compile, > install) works as expected. The problem seems to be in the clean lifecycle, > i.e. possibly somewhere in the Maven Clean Plugin. No matter if I use the > default plugin version 3.5 or upgrade to 3.1.0, the problem occurs when > calling > 'mvn clean' in directory 'productB'. Maybe you should raise an issue. > -- > Alexander Kriegisch > https://scrum-master.de > > > Roy Lenferink schrieb am 28.10.2020 02:18 (GMT +07:00): > >> Hi Alexander, >> >> I just created a test project sketching the scenario I am having. See the >> following repo: >> https://github.com/rlenferink/maven-properties-project >> >> I put the instructions for testing in the README. >> >> In my text example there where indeed some mismatches, I hope the repo with >> sample data >> resolves those unclarities. >> >> Hope someone can clarify whether this is expected Maven behavior or not. >> >> Best regards, >> Roy >> >> On 2020/10/25 02:39:12, "Alexander Kriegisch" <[email protected]> >> wrote: >> >>> Hello Roy. >>> >>> Your textual description is nice and contains a lot of information, but >>> why not attach or link to a simple but complete reproducer project? The >>> reason I am asking is that in order to reproduce this, every reader >>> needs to carefully try to recreate your situation manually. Errors in >>> doing so are likely, especially given the following facts: >>> >>> -- Your directory layout is rather unconventional. >>> -- Your sample artifact naming is cryptic. >>> -- You submodule artifact names differ from directory names. >>> -- You seem to have an artifact named productA-sub1, but also one >>> named productA-submodule1. Are they the same or different? If they >>> are the same, why would you define a dependency on the parent >>> module which probably has POM packaging? >>> >>> Let the POMs speak for themselves, please. Thank you. >>> >>> Cheers >>> -- >>> Alexander Kriegisch >>> https://scrum-master.de >>> >>> >>> Roy Lenferink schrieb am 23.10.2020 17:11 (GMT +07:00): >>> >>> > Hello fellow Maven users, >>> > >>> > At $work a problem occurs with evaluation the ${project.parent.version} >>> from >>> a >>> > child pom. >>> > >>> > The product structure in question: >>> > >>> > Product A: >>> > /pom.xml <= productA-parent (version 10.2.4-SNAPSHOT) >>> > >>> > /submodule1/pom.xml <= productA-sub1 >>> > => submodule1 uses productA-parent as parent >>> > => submodule1 contains submodule2 in its modules section => >>> > <module>../submodule2</module> >>> > >>> > /submodule2/pom.xml <= productA-sub2 >>> > => submodule2 uses submodule1 as parent with relativePath ../submodule1/ >>> > >>> > Submodule2 has a dependency which is activated in a profile which refers >>> > to >>> > submodule1: >>> > <dependencyManagement> >>> > <dependencies> >>> > <dependency> >>> > <groupId>com.work.productA</groupId> >>> > <artifactId>productA-submodule1</artifactId> >>> > <version>${project.parent.version}</version> <= this property is >>> > incorrectly evaluated >>> > <type>pom</type> >>> > <scope>import</scope> >>> > </dependency> >>> > </dependencies> >>> > </dependencyManagement> >>> > >>> > <dependency> >>> > <groupId>com.example.productA</groupId> >>> > <artifactId>productA-submodule1</artifactId> >>> > <version>${project.parent.version}</version> <= this property is >>> > incorrectly evaluated >>> > <type>pom</type> >>> > </dependency> >>> > >>> > Product B: >>> > /pom.xml <= productB-parent (version 0.0.6-SNAPSHOT) >>> > => this uses the productA-sub2 as its parent >>> > >>> > /submodule1/pom.xml <= productB-sub1 >>> > => this uses the productB-parent as its parent. >>> > >>> > The problem I am facing is that I expect that productB-sub1 is able to use >>> > productA-sub2 as >>> > parent. Because productA-sub2 contains a dependency to productA-sub1 I >>> expect >>> > that dependency >>> > will be evaluated correctly. However, it is not and the >>> > ${project.parent.version} in productA-sub2 >>> > is evaluated to the version of productB-parent. >>> > >>> > The extensive error message: >>> > ================================ >>> > [ERROR] Non-resolvable import POM: Failure to find >>> > com.work.productA-sub1:pom:0.0.6-SNAPSHOT in <company repo> was cached in >>> the >>> > local repository, resolution will not be reattempted until the update >>> interval >>> > of <company repo> has elapsed or updates are forced @ >>> > productA-sub2:[unknown-version], >>> > >>> /home/user/.m2/repository/com/work/productA-sub2/10.2.4-SNAPSHOT/productA-sub2-10.2.4-SNAPSHOT.pom, >>> > line 231, column 19 -> [Help 2] >>> > ================================ >>> > >>> > It seems that project.parent.version is evaluated to the version of >>> > productB-parent >>> > (0.0.6-SNAPSHOT) instead of the version of productA-parent >>> (10.2.4-SNAPSHOT). >>> > >>> > How can I ensure that the project.parent.version property resolves to the >>> > correct value (productA >>> > version => 10.2.4-SNAPSHOT) instead of the productB-parent version >>> > (0.0.6-SNAPSHOT) ? >>> > >>> > Hope someone can help me out. >>> > >>> > Best regards, >>> > Roy >>> > >>> > >>> > --------------------------------------------------------------------- >>> > 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] >>> >>> >> >> --------------------------------------------------------------------- >> 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
