Hi,
First time gradle user trying to build an application. Having searched the forums and the documentation, I have not been able to resolve my issue. Looking for some guidance. Thanks in advance.
I have a very simple application and gradle build. I created the project using gradle init and have made simple additions to the gradle.build.
The build fails with an exception:
Plugin [id: ‘org.gretty’, version: ‘4.0.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 ‘org.gretty:org.gretty.gradle.plugin:4.0.3’)
Searched in the following repositories:
Gradle Central Plugin Repository
I have checked the gradle plugin portal and the plugin is there.
The gradle.build file was created using gradle init with some small additions. Build file is as follows:
/*
- This file was generated by the Gradle ‘init’ task.
- This generated file contains a sample Java application project to get you started.
- For more details take a look at the ‘Building Java & JVM projects’ chapter in the Gradle
- User Manual available at Building Java & JVM projects
*/
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id ‘application’
// to embed container
id “org.gretty” version “4.0.3”
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit Jupiter for testing.
testImplementation ‘org.junit.jupiter:junit-jupiter:5.7.2’
// This dependency is used by the application.
implementation ‘com.google.guava:guava:30.1.1-jre’
implementation 'javax.websocket:javax.websocket-api:1.1'
}
application {
// Define the main class for the application.
mainClass = ‘java_websockets.App’
}
tasks.named(‘test’) {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
gretty {
servletContainer = ‘tomcat9’
contextPath = ‘/’
}
Any guidance appreciated. Thanks in advance.
Kevin.