Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better way of configuring command line arguments in the pom [PAXCONSTRUCT-116] #129

Open
ops4j-issues opened this issue Jun 2, 2009 · 2 comments
Labels
Milestone

Comments

@ops4j-issues
Copy link

Richard Wallace created PAXCONSTRUCT-116

To pass custom arguments to pax runner you need to do something like

      <plugin>
        <groupId>org.ops4j</groupId>
        <artifactId>maven-pax-plugin</artifactId>
        <version>1.4</version>
        <configuration>
          <provision>
            <param>--workingDirectory=${project.build.directory}/runner</param>
            <param>--clean=true</param>
            <provision>mybundle</provision>
          </provision>
        </configuration>
      </plugin>

I only found this out by random chance looking at other project poms. It would be much clearer if the configuration could be more along the lines of

      <plugin>
        <groupId>org.ops4j</groupId>
        <artifactId>maven-pax-plugin</artifactId>
        <version>1.4</version>
        <configuration>
          <args>
            <workingDirectory>${project.build.directory}/runner</workingDirectory>
            <clean>true</clean>
          </args>
          <bundles>
            <bundle>mybundle</bundle>
          </bundles>
        </configuration>
      </plugin>

Affects: 1.4
Fixed in: 1.7.0
Votes: 0, Watches: 0

@ops4j-issues
Copy link
Author

Stuart McCulloch commented

Maven only provides a few ways to pass lists/arrays of strings and the one we chose was:

<provision>
<param>sample</param>
<param>option</param>
<param>list</param>
<provision>

http://maven.apache.org/guides/plugin/guide-java-plugin-development.html

which Maven maps to

{ "sample", "option", "list" }

for the provision mojo parameter - note
that you can actually use any word for the tags inside <provision> we just happen to use
"param" as a convention - this format means you can configure any Pax-Runner setting
without the pax-plugin needing to know what settings are valid.

supporting a format like:

<args>
<workingDirectory>$

{project.build.directory}

/runner</workingDirectory>
<clean>true</clean>
</args>

is possible if we use a Map parameter - but then you would potentially lose ordering and
the ability to set multiple entries for the same setting.

similarly supporting:

<bundles>
<bundle>mybundle</bundle>
</bundles>

is possible by using another List parameter - although perhaps <scanners> would be a
better option, as you're actually telling pax-runner to scan a folder here rather than deploy
a specific artifact

one thing I definitely don't want to do is hard-code in-depth knowledge about pax-runner
settings inside the pax-plugin - we must also continue to support existing configurations

@ops4j-issues
Copy link
Author

Stuart McCulloch commented

Target this for 1.5

@ops4j-issues ops4j-issues added this to the 1.7.0 milestone Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant