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

Dependency error on log4j and jengelman.gradle.plugins.shadow2 #3

Closed
Siedlerchr opened this issue Oct 28, 2017 · 6 comments
Closed

Comments

@Siedlerchr
Copy link

Hi,

we are getting the following gradle build error on some CI systems:

Could not find any matches for org.apache.logging.log4j:log4j-core:2.+ as no versions of org.apache.logging.log4j:log4j-core are available.
 Searched in the following locations: 
https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j-core/maven-metadata.xml
Required by:
project : > gradle.plugin.de.sebastianboegl.gradle.plugins:shadow-log4j-transformer:2.1.1

> Could not find any matches for com.github.jengelman.gradle.plugins:shadow:2.+ as no versions of com.github.jengelman.gradle.plugins:shadow are available.
Searched in the following locations:
https://plugins.gradle.org/m2/com/github/jengelman/gradle/plugins/shadow/maven-metadata.xml Required by: project : 
> gradle.plugin.de.sebastianboegl.gradle.plugins:shadow-log4j-transformer:2.1.1
@TheBoegl
Copy link
Owner

TheBoegl commented Nov 2, 2017

Try to use this plugin as library or please provide more information or, even better, a short sample project.

@Siedlerchr
Copy link
Author

Hi,
the above mentioned error occur from using lgtm.com analysis, here is a sample log file with the error.

we are using your plugin in Jabref in our build.gradle:
https://github.com/JabRef/jabref/blob/master/build.gradle in the following way:

plugins {
    id 'com.github.johnrengelman.shadow' version '2.0.1'
    id "de.sebastianboegl.shadow.transformer.log4j" version "2.1.1"
}
shadowJar {
    classifier 'fat'
}

dependencies{
    compile 'commons-logging:commons-logging:1.2'
    compile 'org.apache.logging.log4j:log4j-jcl:2.9.1'
    compile 'org.apache.logging.log4j:log4j-api:2.9.1'
    compile 'org.apache.logging.log4j:log4j-core:2.9.1'
}

@TheBoegl
Copy link
Owner

TheBoegl commented Nov 3, 2017

Does this error only occur in lgtm or somewhere else?
Except from some failing tests the JabRef master branch seems to run OK here...

@Siedlerchr
Copy link
Author

It is only failing on LGTM, I guess it's due to some caching. Travis CI caches dependencies. Our build script first check if the dependencies are locally available, for

@Siedlerchr Siedlerchr reopened this Nov 3, 2017
@Siedlerchr
Copy link
Author

For example, it checks, if they are in a local maven repository available

@TheBoegl
Copy link
Owner

TheBoegl commented Nov 5, 2017

The gradle plugins portal seems to fail to retrieve dynamic versions.
As mentioned above, try to apply this as library. Add jcenter to the buildscript libraries which handles the dynamic versions correctly:

buildscript {
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath 'de.sebastianboegl.gradle.plugins:shadow-log4j-transformer:2.1.1'
    }
}

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

No branches or pull requests

2 participants