Maven 1.x Distribution Plugin

src distribution archive has incorrect directory structure

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7
  • Fix Version/s: 1.7.1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

With Maven 1.1-beta-2 and maven-dist-plugin-1.7:

if my project.xml defines:

<build>
<sourceDirectory>src/main/java</sourceDirectory>
...

Then the dist:build-src target generates an incorrect src distribution file since the source files are packaged to path src/foo/bar/MyClass.java instead of src/main/java/foo/bar/MyClass.java

-

To fix this, change the dist:prepare-src-filesystem goal in maven-dist-plugin-1.7 to read:

<util:available file="src">
<ant:copy todir="${maven.dist.src.assembly.dir}/src">
<ant:fileset dir="src" />
</ant:copy>
</util:available>

This will preserve the actual directory structure.

Issue Links

Activity

Hide
Lukas Theussl added a comment -

This has the disadvantage that "src" will be hardcoded in the jelly script. What if somebody has a <sourceDirectory>source/main/java</sourceDirectory> element? I first thought I'd introduce a new maven.dist.src.dir property, but then realized that the common maven.src.dir would be better fit for that. See MAVEN-1779.

Show
Lukas Theussl added a comment - This has the disadvantage that "src" will be hardcoded in the jelly script. What if somebody has a <sourceDirectory>source/main/java</sourceDirectory> element? I first thought I'd introduce a new maven.dist.src.dir property, but then realized that the common maven.src.dir would be better fit for that. See MAVEN-1779.
Hide
Lukas Theussl added a comment -

Fixed using maven.src.dir. Note that this reverts the fix for MPDIST-12, the sourceDirectory element of the pom has to be a sub-directory of maven.src.dir.

Show
Lukas Theussl added a comment - Fixed using maven.src.dir. Note that this reverts the fix for MPDIST-12, the sourceDirectory element of the pom has to be a sub-directory of maven.src.dir.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: