Skip to content

Change Maven commands to use the maven wrapper #57

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

Open
yeikel opened this issue Mar 6, 2023 · 9 comments
Open

Change Maven commands to use the maven wrapper #57

yeikel opened this issue Mar 6, 2023 · 9 comments
Labels

Comments

@yeikel
Copy link
Contributor

yeikel commented Mar 6, 2023

This recipe can be part of openrewrite/rewrite#1565 and change all the maven references to the maven wrapper

Example:

name: Java CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Build with Maven
        run: mvn --batch-mode --update-snapshots package

Unix runners:

name: Java CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Build with Maven
        run: ./mvn --batch-mode --update-snapshots package

Windows Runners:

 name: Java CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Build with Maven
        run: mvn.cmd --batch-mode --update-snapshots package
@yeikel
Copy link
Contributor Author

yeikel commented Mar 6, 2023

@timtebeek We can create a separate recipe(should it be the same?) for Gradle

@timtebeek timtebeek moved this to Recipes Wanted in OpenRewrite Mar 6, 2023
@timtebeek
Copy link
Contributor

Probably best to create a separate recipe!

@yeikel
Copy link
Contributor Author

yeikel commented Mar 7, 2023

Probably best to create a separate recipe!

That's fair, I created #58

I am expecting a lot of code re-use here

You can assign both to me :)

@yeikel
Copy link
Contributor Author

yeikel commented Mar 7, 2023

Also, how do you think we should detect Windows vs Linux runners?

Few ideas:

@timtebeek
Copy link
Contributor

I'd go with that second heuristic indeed; and likely not make any change if we can't be certain which is in use.
That way we can support the most common use cases already, and people that need more can chime in again.

@yeikel
Copy link
Contributor Author

yeikel commented Mar 7, 2023

Also, how do you think we should detect Windows vs Linux runners?

Few ideas:

For an initial implementation, I would definitely like to support private runners(with user input) as well because this is the norm in Github Enterprise

I am open to implement private runners(GHE) and the public runners approach for the general github.com usage

@yeikel
Copy link
Contributor Author

yeikel commented Mar 7, 2023

@timtebeek Should we do this openrewrite/rewrite#1565 (comment)

As part of this recipe just in case?

@timtebeek
Copy link
Contributor

Can't hurt I suppose; as indeed, if that's not working the recipe will give bad results, loudly.

@timtebeek
Copy link
Contributor

Hope you don't mind I unassigned you @yeikel
I want to open this issue back up again to anyone to pick up.
Feel free to open up a draft pull request if you'd like to contribute!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Recipes Wanted
Development

No branches or pull requests

2 participants