How can I find the plugins by gradle 4.8 in ubuntu 18 please?

My environment:
ubuntu 18.04
openjdk version “1.8.0_171”
Groovy Version: 2.5.0
Gradle 4.8

I just write a Hello.java file, and want get the jar file.

My build.gradle :

plugins {
	id 'java'
	id 'com.github.johnrengelman.plugin-shadow' version '1.2.3'
}

repositories {
	mavenCentral()
	jcenter()
	maven {
		url "https://plugins.gradle.org/m2/"
	}
}

dependencies {
}
	
processResources {
	from 'src/main/java'
}

shadowJar {
	classifier = ''
	manifest {
		attributes 'Main-Class': 'my.Hello'
	}
}

When I run gradle shadowJar, I get these:
FAILURE: Build failed with an exception.

  • Where:
    Build file ‘/home/maven/dev/ubuntu/apps/test/build.gradle’ line: 3

  • What went wrong:
    Plugin [id: ‘com.github.johnrengelman.plugin-shadow’, version: ‘1.2.3’] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
  • Plugin Repositories (could not resolve plugin artifact ‘com.github.johnrengelman.plugin-shadow:com.github.johnrengelman.plugin-shadow.gradle.plugin:1.2.3’)
    Searched in the following repositories:
    Gradle Central Plugin Repository
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

What is my wrong please? And how to fix it please?

There is no such thing as version 1.2.3 of the com.github.johnrengelman.plugin-shadow plugin. This plugin for shadowing Gradle plugins didn’t exist until version 2.0 of Shadow. The actual Shadow plugin for regular use is com.github.johnrengelman.shadow, not com.github.johnrengelman.plugin-shadow.

1 Like

Thank you! That is the solution. I know my problem now. Thank you again.