Re: Problem building only one subproject with ${revision}

2024-06-16 Thread PavelTurk

I tried in main pom.xml:

    
    
    
    org.project
    project-api
    ${project.version}
    
    
    

and in project-foo-bar/pom.xml

    
    
    org.project
    project-api
    ${project.version}
    
    

But it didn't help.

Best regards, Pavel

On 6/16/24 6:24 PM, Lasse Lindqvist wrote:


https://maven.apache.org/maven-ci-friendly.html#dependencies 
<https://maven.apache.org/maven-ci-friendly.html#dependencies> says you should 
use project.version as the variable. So try that if you haven't already.


su 16. kesäk. 2024 klo 18.07 Tommy Svensson mailto:to...@natusoft.se>> kirjoitti:

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 mailto:pavelturk2...@gmail.com>>
Svara: Maven Users List mailto:users@maven.apache.org>>
Datum: 16 juni 2024 at 16:21:00
Till: users@maven.apache.org <mailto: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 
<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:

    
    1.0.0
    

    
    project-foo
    project-api
    

    
    
    
    org.project
project-api
    ${revision}
    
    
    

In Project/project-foo/project-foo-bar/pom.xml I have:


    
    org.project
    project-api
    


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 
<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 
<mailto:users-unsubscr...@maven.apache.org>
For additional commands, e-mail: users-h...@maven.apache.org 
<mailto:users-h...@maven.apache.org>





Re: Problem building only one subproject with ${revision}

2024-06-16 Thread Lasse Lindqvist
https://maven.apache.org/maven-ci-friendly.html#dependencies says you
should use project.version as the variable. So try that if you haven't
already.

su 16. kesäk. 2024 klo 18.07 Tommy Svensson  kirjoitti:

> 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
>
>
>
> Från: PavelTurk 
> Svara: Maven Users List 
> Datum: 16 juni 2024 at 16:21:00
> Till: 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:
>
> 
> 1.0.0
> 
>
> 
> project-foo
> project-api
> 
>
> 
> 
> 
> org.project
> project-api
> ${revision}
> 
> 
> 
>
> In Project/project-foo/project-foo-bar/pom.xml I have:
>
> 
> 
> org.project
> project-api
> 
> 
>
> 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
>
>


Re: Problem building only one subproject with ${revision}

2024-06-16 Thread PavelTurk

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  <mailto:pavelturk2...@gmail.com>
Svara: Maven Users List  <mailto:users@maven.apache.org>
Datum: 16 juni 2024 at 16:21:00
Till: 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:

    
    1.0.0
    

    
    project-foo
    project-api
    

    
    
    
org.project
project-api
${revision}
    
    
    

In Project/project-foo/project-foo-bar/pom.xml I have:


    
    org.project
    project-api
    


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





Re: Problem building only one subproject with ${revision}

2024-06-16 Thread Tommy Svensson
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



Från: PavelTurk 
Svara: Maven Users List 
Datum: 16 juni 2024 at 16:21:00
Till: 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:  

      
    1.0.0  
      

      
    project-foo  
    project-api  
      

      
      
      
    org.project  
    project-api  
    ${revision}  
      
      
      

In Project/project-foo/project-foo-bar/pom.xml I have:  

  
      
    org.project  
    project-api  
      
  

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  



Problem building only one subproject with ${revision}

2024-06-16 Thread PavelTurk

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:

    
    1.0.0
    

    
    project-foo
    project-api
    

    
    
    
    org.project
    project-api
    ${revision}
    
    
    

In Project/project-foo/project-foo-bar/pom.xml I have:


    
    org.project
    project-api
    


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