Maven 2 & 3

SCM path calculations don't work when parent and grandparent are in sibling directories

Details

  • Complexity:
    Intermediate
  • Number of attachments :
    1

Description

I have the following directory structure:

-top

+-grandparent

+-parent

+-child

where modules are specified in grandparent and parent, respectively, as:

<module>../parent</module>

and

<module>../child</module>

When I put these into Continuum, and it tries to use the SCM info provided in the grandparent, it winds up thinking the child directory is a subdirectory of the parent directory.

Activity

Hide
John Casey added a comment -

This is a test directory structure to highlight the flaw here, and verify that it's fixed.

TO VERIFY:

1. cd 2302/top
2. mvn -N install
3. cd ../middle
4. mvn -N install
5. cd ../bottom
6. mvn help:effective-pom | less

Verify that the URL in this POM is:

http://www.google.com/bottom

INCORRECT VALUE IS:

http://www.google.com/top/bottom

Show
John Casey added a comment - This is a test directory structure to highlight the flaw here, and verify that it's fixed. TO VERIFY: 1. cd 2302/top 2. mvn -N install 3. cd ../middle 4. mvn -N install 5. cd ../bottom 6. mvn help:effective-pom | less Verify that the URL in this POM is: http://www.google.com/bottom INCORRECT VALUE IS: http://www.google.com/top/bottom
Hide
John Casey added a comment -

The DefaultMavenProjectBuilder.assembleLineage(..) method was setting the descriptor File instance for the parent MavenProject even when that MavenProject instance had been resolved from the repository. In these cases, the descriptor location is was using was incorrect.

NOTE: I have not captured this in a unit test, or an integration test, as it seems that the current system is incapable of running this test. The method itself does too many things to unit test effectively, and the integration test system currently doesn't support multiple Maven operations per test (required to install the top and middle POMs from the attached test dir into the repository).

Show
John Casey added a comment - The DefaultMavenProjectBuilder.assembleLineage(..) method was setting the descriptor File instance for the parent MavenProject even when that MavenProject instance had been resolved from the repository. In these cases, the descriptor location is was using was incorrect. NOTE: I have not captured this in a unit test, or an integration test, as it seems that the current system is incapable of running this test. The method itself does too many things to unit test effectively, and the integration test system currently doesn't support multiple Maven operations per test (required to install the top and middle POMs from the attached test dir into the repository).

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: