no as the situation is the parent of the parent pom is outside the project.
as far as I know from the codes maven 4 can only dynamically versioning the
parent IF the parent is in same project, means readParentLocally, but for
my situation the parent of parent is spring-boot-starter-parent, thus
outside of my project...it is resolveAndReadParentExternally.
private Model resolveParent(
Model childModel,
Parent parent,
DefaultProfileActivationContext profileActivationContext,
Set<String> parentChain)
throws ModelBuilderException {
Model parentModel = null;
if (isBuildRequest()) {
parentModel = readParentLocally(childModel, parent,
profileActivationContext, parentChain);
}
if (parentModel == null) {
parentModel = resolveAndReadParentExternally(childModel,
parent, profileActivationContext, parentChain);
}
return parentModel;
}
@Tamás Cservenák
I would try Nisse extension to see if it can work with this situation...
never tried nisse before
Guillaume Nodet <[email protected]> 于2025年10月15日周三 12:47写道:
> Can't you use Maven 4, where CI-friendly properties aren't restricted
> anymore and where the version for the whole reactor can be set by a
> property, or even using an extension ?
> JLine does that now : the property is defined by the nisse extension,
> automatically computed from the git history, and defined in a single place,
> in the root pom.
> The children just inherit this version.
> https://github.com/jline/jline3/blob/master/pom.xml#L16
>
> Le mar. 14 oct. 2025 à 11:24, Xeno Amess <[email protected]> a écrit :
>
> > I found out even if I extend the CI-Friendly versions can't I find a
> good
> > way to implement what I want, means declaring parent version from
> > properties.
> > If I really want it I have to modify maven to allow the pom be read, and
> > modify flatten to flatten the version in parent, then add a validator for
> > deploying to avoid some people pass a dynamic parent version to remote...
> >
> > Christoph Läubrich <[email protected]> 于2025年10月14日周二 17:06写道:
> >
> > > Mavens CI-Friendly versions are extensible, see for example:
> > >
> > >
> > >
> >
> https://github.com/eclipse-tycho/tycho/blob/main/tycho-build/src/main/java/org/eclipse/tycho/build/TychoCiFriendlyVersions.java
> > >
> > > but you need to know them by name due to how they work, so there can't
> > > be a simple prefix.
> > >
> > >
> > > Am 14.10.25 um 11:02 schrieb Xeno Amess:
> > > > findout I have to modify both maven and flatten-plugin to allow
> modify
> > > the
> > > > parent, and it be hard to forbid misuse to let dynamic parent version
> > by
> > > > argline
> > > > possibly I should find another idea to achieve this...
> > > >
> > > > Xeno Amess <[email protected]> 于2025年10月11日周六 17:01写道:
> > > >
> > > >> according to the codes we only have 3 of these properties.
> > > >>
> > > >> private static final String SHA1_PROPERTY = "sha1";
> > > >>
> > > >> private static final String CHANGELIST_PROPERTY = "changelist";
> > > >>
> > > >> private static final String REVISION_PROPERTY = "revision";
> > > >>
> > > >>
> > > >> should we add a new set of them (likely a prefix like ci_friendly_*
> )
> > > >>
> > > >> ----------
> > > >>
> > > >> the reason I want it is I have several repos who both inherited
> from a
> > > pom
> > > >> of a version, and use a same version number elsewhere.
> > > >>
> > > >> for example
> > > >>
> > > >> we have
> > > >>
> > > >> <parent>
> > > >> <groupId>org.springframework.boot</groupId>
> > > >> <artifactId>spring-boot-starter-parent</artifactId>
> > > >> <version>3.5.6</version>
> > > >> <relativePath></relativePath>
> > > >> </parent>
> > > >>
> > > >> and same time
> > > >>
> > > >> <properties>
> > > >> <java.version>21</java.version>
> > > >> <springboot.version>3.5.6</springboot.version>
> > > >> <revision>0.0.1</revision>
> > > >>
> <native.maven.plugin.version>0.11.0</native.maven.plugin.version>
> > > >> <graalpy.version>25.0.0</graalpy.version>
> > > >> <antlr.version>3.5.3</antlr.version>
> > > >> <antlr4.version>4.13.2</antlr4.version>
> > > >> <antlr4-c3.version>1.2.0x</antlr4-c3.version>
> > > >> <grpc.version>1.76.0</grpc.version>
> > > >> <protobuf.version>4.32.1</protobuf.version>
> > > >>
> > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> > > >> <gop-root>${maven.multiModuleProjectDirectory}</gop-root>
> > > >> <maven.compiler.proc>full</maven.compiler.proc>
> > > >> <surefire-report-phase>prepare-package</surefire-report-phase>
> > > >> <os-maven-plugin.version>1.7.1</os-maven-plugin.version>
> > > >>
> > > <protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
> > > >> <replacer.version>1.5.3</replacer.version>
> > > >> </properties>
> > > >>
> > > >> and
> > > >>
> > > >> <dependency>
> > > >> <groupId>org.springframework.boot</groupId>
> > > >>
> > >
> <artifactId>spring-boot-starter-oauth2-authorization-server</artifactId>
> > > >> <version>${springboot.version}</version>
> > > >> </dependency>
> > > >>
> > > >> so seems it be better to let the version in parent use a same
> > propertie
> > > >> with the dependency.
> > > >> so we have to use a ci friendly property
> > > >> but we already use revision for the project version, and
> > sha/changelist
> > > >> seems not quite suitable
> > > >> so maybe we shall add rule to make every of ci_friendly_* property
> be
> > > >> ci_friendly property?
> > > >>
> > > >>
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [email protected]
> > > For additional commands, e-mail: [email protected]
> > >
> > >
> >
>
>
> --
> ------------------------
> Guillaume Nodet
>