Skip to content

build.gradle: should reference mavenLocal() #1960

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

Closed
wfouche opened this issue Mar 20, 2025 · 4 comments · Fixed by #1964
Closed

build.gradle: should reference mavenLocal() #1960

wfouche opened this issue Mar 20, 2025 · 4 comments · Fixed by #1964
Labels
bug Something isn't working

Comments

@wfouche
Copy link
Contributor

wfouche commented Mar 20, 2025

Describe the bug
jbang export gradle App.java does not include mavenLocal() as a repository in the generated build.gradle file

JBang version
0.125.0

Additional context

plugins {
        id 'java'
        id 'application'
}


repositories {
        mavenCentral()
}

...
@wfouche wfouche added the bug Something isn't working label Mar 20, 2025
@maxandersen
Copy link
Collaborator

you are probably right - got an example where that is breaking things?

@wfouche
Copy link
Contributor Author

wfouche commented Mar 20, 2025

@maxandersen , the scenario is that I'm developing a new SNAPSHOT version of a JAR file I will eventually publish to Maven Central.

If App.java has this SNAPSHOT jar defined as a dependency, then jbang run App.java automatically retrieves the JAR from the local maven repository.

When I create a build.gradle file from App.java, then mavenLocal() is not defined by default, so gradle build fails to compile App.java. If I add localMaven() to the build.gradle file manually, then the problem is resolved.

In order to be behaviourly compatible with 'jbang run ...' , build.gradle should define mavenLocal() as a repository.

Copy link
Collaborator

Wanna make a pr ? :)

@wfouche
Copy link
Contributor Author

wfouche commented Mar 23, 2025

Should be made a sub-issue of #1944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants