I did it. If you try to build whole project - it will be build and now project
version is set only in one place - in main pom.xml -
see the link I provided to github project.
The problem is that when you are working on one module you need to rebuild only
it (using IDE key combinations).
And here as I wrote I have a problem.
So, if anyone helps to fix it, there will be a complete solution.
Best regards, Pavel
On 6/16/24 6:06 PM, Tommy Svensson wrote:
Well this:
|The following artifacts could not be resolved:
org.project:project:pom:${revision} (absent):|
Says that maven does not resolve |${revision}| to a value.
|I want to set project version for all modules and their children only in one
place - in properties of the main pom.xml|
I’ve tried to accomplish the same myself, but gave upp! Even if you have a top
pom and all other artifacts are sub-modules to that, it does not work! I spent
a lot of time trying to make this work, but finally just gave upp. And I have
been using maven for a very long time!
If anyone know a way to accomplish this without writing a tool that generates
POM:s, please share it here :-).
And *NO*, don’t ever get an idea to write a tool that generates POM:s! That was
a joke OK! :-)
Tommy Svensson
to...@natusoft.se <mailto:to...@natusoft.se>
Från: PavelTurk <pavelturk2...@gmail.com> <mailto:pavelturk2...@gmail.com>
Svara: Maven Users List <users@maven.apache.org> <mailto:users@maven.apache.org>
Datum: 16 juni 2024 at 16:21:00
Till: users@maven.apache.org <users@maven.apache.org>
<mailto:users@maven.apache.org>
Ämne: Problem building only one subproject with ${revision}
Hello all,
I have a project (https://github.com/PavelTurk/maven-revision-test ) with
subprojetcs and I want to set project version for all
modules and their children only in one place - in properties of the main
pom.xml. The project has the following structure:
Project
|-- project-api
|-- project-foo
|-- project-foo-bar (uses project-api)
In Project/pom.xml I have:
<properties>
<revision>1.0.0</revision>
</properties>
<modules>
<module>project-foo</module>
<module>project-api</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.project</groupId>
<artifactId>project-api</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</dependencyManagement>
In Project/project-foo/project-foo-bar/pom.xml I have:
<dependencies>
<dependency>
<groupId>org.project</groupId>
<artifactId>project-api</artifactId>
</dependency>
</dependencies>
When I build whole project (via mvn clean install in Project folder) then all
modules are built without any problems.
However, when I want to build only ONE SUBPROJECT - project-foo-bar (via mvn
clean install in Project/project-foo/project-foo-bar) I get:
[ERROR] Failed to execute goal on project project-foo-bar: Could not resolve
dependencies for project org.project.foo:project-foo-bar:jar:1.0.0: Failed to
collect dependencies at org.project:project-api:jar:1.0.0: Failed to read artifact
descriptor for org.project:project-api:jar:1.0.0: The following artifacts could
not be resolved: org.project:project:pom:${revision} (absent):
org.project:project:pom:${revision} was not found in
https://repo.maven.apache.org/maven2 during a previous attempt. This failure was
cached in the local repository and resolution is not reattempted until the update
interval of central has elapsed or updates are forced -> [Help 1]
Could anyone say how to fix it?
Best regards, Pavel
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org