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

Jib builder should autodetect Maven vs Gradle #1134

Closed
briandealwis opened this issue Oct 10, 2018 · 3 comments · Fixed by #2808
Closed

Jib builder should autodetect Maven vs Gradle #1134

briandealwis opened this issue Oct 10, 2018 · 3 comments · Fixed by #2808

Comments

@briandealwis
Copy link
Member

briandealwis commented Oct 10, 2018

From #1096:

@dgageot:

Is there a way to add a single type of artifact called Jib that auto-detects if it's a gradle or a maven build? That would make the config easier to read/write. I know the maven and gradle configs don't have the same parameters though.

@coollog:

Yep, we can definitely auto-detect Gradle/Maven (via detection of pom.xml or build.gradle or the respective wrappers). However, the concern is which priority to detect these in. For example, someone could have both pom.xml and build.gradle and those files could be named differently as well. The wrappers could also both be present. In any case, we would also need to provide a user configuration for Maven or Gradle as a fallback in case the auto-detection was incorrect. This detection could probably be specified via a buildFile parameter where passing in an .xml file would mean Maven and .gradle file would be Gradle.

@dgageot:

Maybe have a jib artifact with a type property. Type would be auto-detected unless the user specifies maven or gradle. Once again, it can be changed later but I think it makes the configuration simpler.

@briandealwis:

For the Maven case we need to look for a pom.xml or a .mvn/ directory — Maven now supports a polyglot mode (e.g., using groovy or Scala or other formats for expressing the project model), so pom.xml may not exist.

@loosebazooka:

Maven and Gradle will probably have different configuration parameters. We might need to make it nested to handle a single jib artifact.

jib {
  maven {
    profile = "asdf"
    ...
  }
}

// or

jib {
  gradle {
    ...
  }
}
@briandealwis
Copy link
Member Author

@coollog have you seen situations in the wild with both a build.gradle and pom.xml? What are they trying to do?

@coollog
Copy link
Contributor

coollog commented Nov 9, 2018

I haven't seen that personally - I just sometimes have both in example projects to show using Maven and Gradle. I think this autodetect would be useful for init as well #1264 so that init creates the skaffold.yaml with the right artifact configuration.

@dgageot
Copy link
Contributor

dgageot commented Jul 2, 2019

Let's close this one. This is not something considered in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants