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

gradle build fails with duplicate META-INF/LICENSE reference #18

Open
bmorris-ocsd opened this issue Jun 8, 2022 · 0 comments
Open

Comments

@bmorris-ocsd
Copy link

I'm on Linux Manjaro and I was trying to build decaf from the src and when I would run: gradle build
it would fail for the jar task stating something about a duplicate META-INF/LICENSE file. The fix for me was this:

The original snippet of the build.gradle file:
`tasks.compileJava.dependsOn tasks.ll1pg

jar {
manifest {
attributes 'Main-Class': 'decaf.Main'
}

// Create a fat JAR with all the dependencies.
from {
    configurations.runtimeClasspath.collect {
        it.isDirectory() ? it : zipTree(it)
    }
}

}`

I changed it to:
`tasks.compileJava.dependsOn tasks.ll1pg

jar {
setDuplicatesStrategy(DuplicatesStrategy.INCLUDE);
manifest {
attributes 'Main-Class': 'decaf.Main'
}

// Create a fat JAR with all the dependencies.
from {
    configurations.runtimeClasspath.collect {
        it.isDirectory() ? it : zipTree(it)
    }
}

}`

and now, despite giving an error about JavaExecHandlerBuilder.setMain(String) method being deprecated, it compiles. I also changed the commons-cli version from 1.5 to 1.5.0 though I'm not sure if that matters.

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

No branches or pull requests

1 participant