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

Jar tasks :file option could treat input string as template #617

Open
jgrzebyta opened this issue Jun 16, 2017 · 5 comments
Open

Jar tasks :file option could treat input string as template #617

jgrzebyta opened this issue Jun 16, 2017 · 5 comments

Comments

@jgrzebyta
Copy link

boot.task.built-in/jar uses the argument :file value literally. It would be useful if the value was treated as a template. For exmaple "{project}-{version}-standalone.jar".

@martinklepsch
Copy link
Member

martinklepsch commented Jun 16, 2017

@jgrzebyta the jar task itself has little knowledge about the project and version. These things are encoded in a pom.xml file (see pom task) which eventually ends up inside the Jar.

If you have project & version defined in your build.boot you can also just do something like this:

(jar :file (str project "-" version "-standalone.jar")

I think this is preferable over string templating and since you pass project and version to the pom task anyways it's probably not a big deal to move those to their own defs.

Sidenote: There is also some code to determine the jar name from a pom file but it does not always work well when building uberjars. You may try to use the jar tasks project option if it doesn't.

@jgrzebyta
Copy link
Author

The problem occurs when the version is setup by external tool (boot-semver for example). Details described at degree9/boot-semver#60 .

I fixed that issue and will send PR.

@martinklepsch
Copy link
Member

martinklepsch commented Jun 16, 2017

@jgrzebyta are you using boot-semver's version-pom task? If you do, I think the jar task should pick up the project and version accordingly. Maybe also @flyboarder can weigh in how he solves this issue when using boot-semver.

While it's great that you provide a patch in #618 I think this needs a bit more discussion before we can decide whether to add a feature that allows this kind of jar name string interpolation.

@burn2delete
Copy link
Contributor

Boot-semver patches the built-in tasks by first checking an internal atom before defaulting to task options for the version and project strings. I believe the correct patch would be to check the boot env instead of my atom.

@jgrzebyta
Copy link
Author

jgrzebyta commented Jun 16, 2017 via email

@martinklepsch martinklepsch changed the title [new feature] Jar :file task would treat an input string as template Jar tasks :file option could treat input string as template Dec 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants