Am 12/05/16 um 21:51 schrieb Florian Schätz:
> Hello,
> 
> On 05/12/2016 21:37, Christian Schulte wrote:
> 
>> Only way to get at that would be to declare a property in that
>> grandparent's POM. The parent/child hierarchies really are used in the
>> opposite way. You inherit versions from parents, for example (top-down,
>> so to say). What use-case is it requiring access to a grandparent's
>> version (bottom-up)?
> 
> Ok, basically, I have three projects:
> 
> shared-core
>   +some modules
> application1
>   +some modules
> application2
>   +some modules
> 
> application1 and application2 both use the shared-core project's modules 
> as dependencies, the application's top level project is just a pom (for 
> more specific dependency management). During each development cycle 
> (sprint), the shared-core will also be worked on and at the end, 
> released (with a different version than the application itself). So, 
> what we did is putting the parent pom (for dependency management) into 
> the shared-core, giving us this parent pom hierarchy...
> 
> shared-core pom.xml (pom)
>   - shared-core module1 pom.xml (jar)
>   - shared-core module2 pom.xml (jar)
>   - application1 parent pom.xml (pom)
>     - application 1 module 1 pom.xml (jar)
>     - application 1 module 2 pom.xml (jar)
>   - application2 parent pom.xml (pom)
>     - application 2 module 1 pom.xml (jar)
>     - application 2 module 2 pom.xml (jar)
> etc.
> 

I would split this into three standalone multi-module projects. The
"shared" multi-module project, the "app1" multi-module project and the
"app2" multi-module project. In the "app1" and "app2" POMs I would use a
property for the version to use of "shared" and maybe I would make the
"shared" multi-module project provide a POM packaging project providing
dependency management information to be imported in "app1" or "app2"
using the "import" scope feature. I would use SNAPSHOTs during
development so that you do not need to update "app1" or "app2" POMs
whenever something in "shared" changes. I would then use the release
plugin whenever I would want to release "app1" or "app2" and that would
notice that SNAPSHOT versions are in use and would ask for the release
version to use. That may lead to releasing "shared" before. Once "app1"
or "app2" have been set to release versions of "shared", you will not
update that to a SNAPSHOT when the changes in  "shared" are not needed
in "app1" or "app2" sooner or later. Will you really ever release "app1"
and "app2" in one go once you've performed some initial releases? How
would you handle bugfix/hotfix releases? All of this just to not "mvn
install" shared when something has changed independently of "app1" or
"app2"?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to