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)
  • Maven 2.x Exec Plugin
  • MEXEC-30

A directory cannot be added to the classpath in exec or java

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0.2, 1.1-beta-1
  • Fix Version/s: None
  • Component/s: exec, java
  • Labels:
    None
  • Environment:
    WinXP/Java 1.5

Description

There is no mechanism for adding a directory to the classpath for the plugin, there is only a mechanism for adding a jar.

Use case: adding a properties file to the claspath of the plugin without wishing that properties file to be included in the artifact jar.

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

Attachments

  1. File
    MEXEC-30.diff
    25/Aug/07 2:34 PM
    22 kB
    Jerome Lacoste

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Jerome Lacoste added a comment - 25/Aug/07 6:08 AM

Taking. Will do later today.

Show
Jerome Lacoste added a comment - 25/Aug/07 6:08 AM Taking. Will do later today.
Hide
Permalink
Jerome Lacoste added a comment - 25/Aug/07 2:34 PM

The attached patch adds the requested functionality for the exec mojo. Not the java one.
The patch also:

  • allows to use regular expressions to match dependencies
  • adds a warning if one uses in his/her path a <dependency> that matches none of the project dependencies
  • keep the dependencies in the order they are defined in the <classpath> section

With that patch, one is forced to use the <classpath> element to specify these new path elements, hence the implementation of the regular expression support.

Below is the example of the change in documentation which should give a feel how this would work.

Adding the same functionality to the java mojo would require a different user configuration. So I am unsure if this is the right way to do it.
Feel free to comment on the patch. I don't intend to commit it as is as I am not satisfied with the way the user configuration is going nor the way the 2 main exec mojos stay in sync. There must be a better way.

+ dependencies can also be regular expressions:

+-------------------
+ ...
+ <classpath>
+ <dependency>commons.*</dependency>
+ </classpath>
+ ...
+-------------------
+
+Finally one can also add extra locations (e.g. for resources that one don't want to be packaged)
+
+-------------------
+ ...
+ <classpath>
+ <element>src/main/nonpackagedresources</element>
+ <dependency>.*</dependency>
+ </classpath>
+ ...

Show
Jerome Lacoste added a comment - 25/Aug/07 2:34 PM The attached patch adds the requested functionality for the exec mojo. Not the java one. The patch also:
  • allows to use regular expressions to match dependencies
  • adds a warning if one uses in his/her path a <dependency> that matches none of the project dependencies
  • keep the dependencies in the order they are defined in the <classpath> section
With that patch, one is forced to use the <classpath> element to specify these new path elements, hence the implementation of the regular expression support. Below is the example of the change in documentation which should give a feel how this would work. Adding the same functionality to the java mojo would require a different user configuration. So I am unsure if this is the right way to do it. Feel free to comment on the patch. I don't intend to commit it as is as I am not satisfied with the way the user configuration is going nor the way the 2 main exec mojos stay in sync. There must be a better way. + dependencies can also be regular expressions: +------------------- + ... + <classpath> + <dependency>commons.*</dependency> + </classpath> + ... +------------------- + +Finally one can also add extra locations (e.g. for resources that one don't want to be packaged) + +------------------- + ... + <classpath> + <element>src/main/nonpackagedresources</element> + <dependency>.*</dependency> + </classpath> + ...
Hide
Permalink
Maik Richey added a comment - 13/May/10 2:38 PM - edited

This feature could be of general interest I think but didn't make it into any release unfortunately.
I couldn't find a version the patch can be applied to without much difficulty. Especially trying to apply the patch to the latest version was problematic cause that one changed very much compared to the version the patch is based on. Could someone experienced adapt the patch for the latest version? Would be nice having that feature in one of the next releases.

Show
Maik Richey added a comment - 13/May/10 2:38 PM - edited This feature could be of general interest I think but didn't make it into any release unfortunately. I couldn't find a version the patch can be applied to without much difficulty. Especially trying to apply the patch to the latest version was problematic cause that one changed very much compared to the version the patch is based on. Could someone experienced adapt the patch for the latest version? Would be nice having that feature in one of the next releases.
Hide
Permalink
Maik Richey added a comment - 27/May/10 5:52 PM

All right, was able to apply the patch from Jerome to 1.1-beta-1 finally. After that I merged the changes from 1.1.1 done after creating the TAG for 1.1-beta-1 into the patched version. Done so far. Have to do some cleanup and testing but I'm quite confident by now. I'll be back tomorrow the earliest...

Show
Maik Richey added a comment - 27/May/10 5:52 PM All right, was able to apply the patch from Jerome to 1.1-beta-1 finally. After that I merged the changes from 1.1.1 done after creating the TAG for 1.1-beta-1 into the patched version. Done so far. Have to do some cleanup and testing but I'm quite confident by now. I'll be back tomorrow the earliest...

People

  • Assignee:
    Jerome Lacoste
    Reporter:
    Tim Pizey
Vote (2)
Watch (2)

Dates

  • Created:
    17/Aug/07 8:35 AM
    Updated:
    27/May/10 5:52 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.