jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Maven 2.x Assembly Plugin
  • Maven 2.x Assembly Plugin
  • MASSEMBLY-343

add symbolic links managment

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Wish Wish
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.2-beta-2
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    linux, ubuntu
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

Description

i need to buid archives ( tar for example ) with symbolic links

the plugin build an archive with a file containing the destination of the link, not the link itself

=> the plugin need an option to know if deferencement of links is needed
this is just like -h option of tar
-h, --dereference
don't dump symlinks; dump the files they point to

actually, if you do an archive of /lib, for example, many file will be in double with différent names. extract of archive will not be the exactly the same as the source of the archive. => this is a test !

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    MASSEMBLY-343_maven-assembly-plugin_fixed.patch
    18/Sep/12 1:51 AM
    38 kB
    Zuhayr Khan
  2. Text File
    MASSEMBLY-343_maven-assembly-plugin.patch
    22/Sep/11 11:48 AM
    39 kB
    Zuhayr Khan

Issue Links

depends upon

Improvement - An improvement or enhancement to an existing feature or task. PLXCOMP-117 add symbolic links managment

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Zuhayr Khan added a comment - 22/Sep/11 11:47 AM - edited

I have implemented a solution for symbolic link support in maven-assembly-plugin with changes to plexus-io and plexus-archive (see my comments on PLXCOMP-117)

I added definitions to the assembly format that allow for symlinks to be defined in an assembly.xml as follows...

<symlinks>
<symlink>
<name>symlink_name</name>
<destination>../symlink_destination</destination>
</symlink>
</symlinks>

...I think this is in-keeping with other resources, but I'm happy to hear others' views.

I will attach a patch for consideration; I think/hope I have followed the coding standards - I am watching this and PLXCOMP-117 so please feel free to ask any questions through comments on whichever is appropriate.

Show
Zuhayr Khan added a comment - 22/Sep/11 11:47 AM - edited I have implemented a solution for symbolic link support in maven-assembly-plugin with changes to plexus-io and plexus-archive (see my comments on PLXCOMP-117 ) I added definitions to the assembly format that allow for symlinks to be defined in an assembly.xml as follows... <symlinks> <symlink> <name>symlink_name</name> <destination>../symlink_destination</destination> </symlink> </symlinks> ...I think this is in-keeping with other resources, but I'm happy to hear others' views. I will attach a patch for consideration; I think/hope I have followed the coding standards - I am watching this and PLXCOMP-117 so please feel free to ask any questions through comments on whichever is appropriate.
Hide
Permalink
Zuhayr Khan added a comment - 22/Sep/11 11:48 AM

This patch (MASSEMBLY-343_maven-assembly-plugin.patch) adds support for symlinks to maven-assembly-plugin

Show
Zuhayr Khan added a comment - 22/Sep/11 11:48 AM This patch ( MASSEMBLY-343 _maven-assembly-plugin.patch) adds support for symlinks to maven-assembly-plugin
Hide
Permalink
Ahmed El-Madhoun added a comment - 13/Sep/12 12:46 PM

Hi Zuhayr,

I am running into a similar issue where I really need to support sym links as part of the assembly procedure. Do you know what version of the assembly plugin this patch is for? I would like to apply this patch and use it if possible.

Thanks in advance.

Show
Ahmed El-Madhoun added a comment - 13/Sep/12 12:46 PM Hi Zuhayr, I am running into a similar issue where I really need to support sym links as part of the assembly procedure. Do you know what version of the assembly plugin this patch is for? I would like to apply this patch and use it if possible. Thanks in advance.
Hide
Permalink
Zuhayr Khan added a comment - 14/Sep/12 1:12 AM - edited

Hi Ahmed,

The version I had locally which I patched was maven-assembly-plugin:2.2.1

Hope that helps.

BTW.. there's more comment and discussion on it's possible inclusion on the PLXCOMP-117 issue. I'm more than happy to adjust/re-work these solutions so it can form part of the actual released plugin if there's sufficient interest.

Zuhayr

Show
Zuhayr Khan added a comment - 14/Sep/12 1:12 AM - edited Hi Ahmed, The version I had locally which I patched was maven-assembly-plugin:2.2.1 Hope that helps. BTW.. there's more comment and discussion on it's possible inclusion on the PLXCOMP-117 issue. I'm more than happy to adjust/re-work these solutions so it can form part of the actual released plugin if there's sufficient interest. Zuhayr
Hide
Permalink
Ahmed El-Madhoun added a comment - 14/Sep/12 1:01 PM

Hi Zuhayr,

Thanks for the response. I am trying out this patch and I am just having little trouble applying the patches. From what you have told me, I am using the following maven plugin and plexus components:

maven-assembly-plugin 2.2.1
plexus-archiver 1.1
plexus-io 1.0.1

I do get some failures applying the patch, I did not look further into it, but I will later tonight. I just want to check that I am using the right versions.

Thanks again and great work so far, any reason why this is not yet officially incorporated?

Show
Ahmed El-Madhoun added a comment - 14/Sep/12 1:01 PM Hi Zuhayr, Thanks for the response. I am trying out this patch and I am just having little trouble applying the patches. From what you have told me, I am using the following maven plugin and plexus components: maven-assembly-plugin 2.2.1 plexus-archiver 1.1 plexus-io 1.0.1 I do get some failures applying the patch, I did not look further into it, but I will later tonight. I just want to check that I am using the right versions. Thanks again and great work so far, any reason why this is not yet officially incorporated?
Hide
Permalink
Ahmed El-Madhoun added a comment - 16/Sep/12 3:10 PM

Hi Zuhayr,

I was able to get the proper revisions of the maven plugins and plexus components (as listed above), however, I am having trouble building the assembly plugin. All code patches fine, except that I run into this issue:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/aelmadho/ASSEMBLY/maven/plugins/maven-assembly-plugin-2.2.1/target/generated-sources/modello/org/apache/maven/plugin/assembly/model/io/xpp3/AssemblyXpp3Writer.java:[291,119] error: unclosed string literal
[ERROR] /home/aelmadho/ASSEMBLY/maven/plugins/maven-assembly-plugin-2.2.1/target/generated-sources/modello/org/apache/maven/plugin/assembly/model/io/xpp3/AssemblyXpp3Writer.java:[292,10] error: unclosed string lite

The file in context (AssemblyXpp3Writer) looks like this at line 291-292:

if ( ( dependencySet.getOutputFileNameMapping() != null ) && !dependencySet.getOutputFileNameMapping().equals( "$

{artifact.artifactId}

$

{artifact.version}

$

{dashClassifier?}

.$

{artifact.extension}

" ) )

{ serializer.startTag( NAMESPACE, "outputFileNameMapping" ).text( dependencySet.getOutputFileNameMapping() ).endTag( NAMESPACE, "outputFileNameMapping" ); }

There seems to be a "\n" character at the end of the logical comparison that the parser fails. I am not very familiar with Xpp3, I need to do some more reading there, but I was hoping to try and generate maven artifacts including symlinks using the solution you have proposed.

Any idea on how I can proceed?

Thanks a bunch.

Show
Ahmed El-Madhoun added a comment - 16/Sep/12 3:10 PM Hi Zuhayr, I was able to get the proper revisions of the maven plugins and plexus components (as listed above), however, I am having trouble building the assembly plugin. All code patches fine, except that I run into this issue: [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/aelmadho/ASSEMBLY/maven/plugins/maven-assembly-plugin-2.2.1/target/generated-sources/modello/org/apache/maven/plugin/assembly/model/io/xpp3/AssemblyXpp3Writer.java: [291,119] error: unclosed string literal [ERROR] /home/aelmadho/ASSEMBLY/maven/plugins/maven-assembly-plugin-2.2.1/target/generated-sources/modello/org/apache/maven/plugin/assembly/model/io/xpp3/AssemblyXpp3Writer.java: [292,10] error: unclosed string lite The file in context (AssemblyXpp3Writer) looks like this at line 291-292: if ( ( dependencySet.getOutputFileNameMapping() != null ) && !dependencySet.getOutputFileNameMapping().equals( "$ {artifact.artifactId} $ {artifact.version} $ {dashClassifier?} .$ {artifact.extension} " ) ) { serializer.startTag( NAMESPACE, "outputFileNameMapping" ).text( dependencySet.getOutputFileNameMapping() ).endTag( NAMESPACE, "outputFileNameMapping" ); } There seems to be a "\n" character at the end of the logical comparison that the parser fails. I am not very familiar with Xpp3, I need to do some more reading there, but I was hoping to try and generate maven artifacts including symlinks using the solution you have proposed. Any idea on how I can proceed? Thanks a bunch.
Hide
Permalink
Zuhayr Khan added a comment - 18/Sep/12 1:51 AM

Thanks Ahmed - seems a rogue line-ending caused the issue you noted.

I now attached a fixed version of the patch. Hopefully this should solve your problem.

Zuhayr

Show
Zuhayr Khan added a comment - 18/Sep/12 1:51 AM Thanks Ahmed - seems a rogue line-ending caused the issue you noted. I now attached a fixed version of the patch. Hopefully this should solve your problem. Zuhayr
Hide
Permalink
Ahmed El-Madhoun added a comment - 18/Sep/12 9:09 AM

Hi Zuhayr,

Thanks for the fix, I am now able to build and test the patch. I am not seeing the symlinks respected. I am simply using assembly to archive an artifact that contains a number of symlinks, but they are all hard links.

Do I need to specify any configuration in the descriptor to ensure that symlinks are kept?

Show
Ahmed El-Madhoun added a comment - 18/Sep/12 9:09 AM Hi Zuhayr, Thanks for the fix, I am now able to build and test the patch. I am not seeing the symlinks respected. I am simply using assembly to archive an artifact that contains a number of symlinks, but they are all hard links. Do I need to specify any configuration in the descriptor to ensure that symlinks are kept?
Hide
Permalink
Ahmed El-Madhoun added a comment - 18/Sep/12 9:11 AM

By the way, I am using Maven 3, but I don't think that is an issue, would it be?

Show
Ahmed El-Madhoun added a comment - 18/Sep/12 9:11 AM By the way, I am using Maven 3, but I don't think that is an issue, would it be?
Hide
Permalink
Zuhayr Khan added a comment - 18/Sep/12 11:46 AM

It sounds like you're hoping that the assembly plugin will look at symlinks on your file-system and include them within the assembled package?

This use case is what the discussion on PLXCOMP-117 covers. In summary, because of the lack of system-agnostic support for symbolic links (pre Java 7?) plexus-io doesn't read/identify symlinks in this manner.

The patch here simply allows you to configure symlinks within the assembly-definition such that they are recorded in the tar/zip file as symlinks.

If I've understood your use case correctly, to take advantage of this, you'd need to add a "symlinks" element (see my initial comment on this) to your assembly-definition that correspond to the actual symlinks on your file system.

Hope that helps.

Show
Zuhayr Khan added a comment - 18/Sep/12 11:46 AM It sounds like you're hoping that the assembly plugin will look at symlinks on your file-system and include them within the assembled package? This use case is what the discussion on PLXCOMP-117 covers. In summary, because of the lack of system-agnostic support for symbolic links (pre Java 7?) plexus-io doesn't read/identify symlinks in this manner. The patch here simply allows you to configure symlinks within the assembly-definition such that they are recorded in the tar/zip file as symlinks. If I've understood your use case correctly, to take advantage of this, you'd need to add a "symlinks" element (see my initial comment on this) to your assembly-definition that correspond to the actual symlinks on your file system. Hope that helps.
Hide
Permalink
Ahmed El-Madhoun added a comment - 18/Sep/12 11:49 AM

I kind of figured that out once I looked more into the patch and this case. I am thinking of porting assembly plugin into JDK7 with ability to automatically package symlinks, would you be interested in helping out?

Show
Ahmed El-Madhoun added a comment - 18/Sep/12 11:49 AM I kind of figured that out once I looked more into the patch and this case. I am thinking of porting assembly plugin into JDK7 with ability to automatically package symlinks, would you be interested in helping out?

People

  • Assignee:
    Unassigned
    Reporter:
    Godet Gilles
Vote (8)
Watch (5)

Dates

  • Created:
    25/Jul/08 2:49 PM
    Updated:
    02/Nov/12 5:41 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.