Azure / draft

A day 0 tool for getting your app on k8s fast
MIT License
515 stars 61 forks source link

Draft Create Auto Detect pom.xml file during Java detection #223

Open msftph opened 1 year ago

msftph commented 1 year ago

Is your feature request related to a problem? Please describe.

When running draft create on the following folder https://github.com/buildpacks/samples/blob/main/apps/java-maven/, draft shows the following prompt:

[Draft] --- Detecting Language ---
Use the arrow keys to navigate: ↓ ↑ → ←
? Linguist detected Java, are you using maven or gradle?:
    gradle
  > maven

Mention what platform you want to support the new feature

OSS draft

Describe the solution you'd like

Draft should detect that maven is being used by seeing the pom.xml file in the repository.

Describe alternatives you've considered

There may be a better way to detect maven.

Additional context

(none)

davidgamero commented 1 year ago

thanks for the suggestion! this is a great point

we probably can add a more provider-based approach, but a simple check in here would do it using the RepoReader to test if a pom.xml exists

what do you think @hsubramanianaks ?

hsubramanianaks commented 1 year ago

@davidgamero Yep agree we can detect (look for pom.xml or *.gradle using repo reader) before prompting to users.