Authentication scheme 'all'(Authentication) is not supported by protocol 'file'

I am trying to publish a jar file to MavenCentral. So far, I have managed to build the jar file on my own machine, but keep getting the above message when I try to publish to Maven. I am using “gradle publish”, as I’m not sure if “publish” gets triggered automatically. I am sure there are many mistakes in my script, as this is my attempt to migrate the old working script fom Gradle 5 to 6.1.1.

I have inserted some println’s, and it seems that any string I put into the variable called “url” gets a “file:” added in front. However, I lifted that code from the 6.1.1 tutorial…

PS Is there an editor which will let me locate matching brackets…?

My build.gradle is as follows:

buildscript {
repositories {
mavenCentral()
}

dependencies {
    classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"      
    //classpath 'com.github.rholder:gradle-one-jar:1.0.4'          
 
}

}

//plugins {
// id ‘maven’
//}

apply plugin: ‘io.codearte.nexus-staging’

subprojects {

    task javadocJar(type: Jar) {
        classifier = 'javadoc'
        from javadoc
    }

    task sourcesJar(type: Jar) {
        classifier = 'sources'
        from sourceSets.main.allSource
    }

    artifacts {
        archives javadocJar, sourcesJar
    }
}

allprojects {
apply plugin: ‘java’
apply plugin: ‘eclipse’
apply plugin: ‘application’
//apply plugin: ‘maven’
apply plugin: ‘maven-publish’
apply plugin: ‘signing’
apply plugin: ‘java-library’

}

version = ‘2.19.2’

group = ‘com.jpaulmorrison’

description = ‘DrawFBP is a picture-drawing tool that allows users to create multi-level diagrams implementing the technology and methodology known as Flow-Based Programming (FBP). Diagrams are saved in DrawFBP XML format, and will generate JavaFBP or C#FBP networks.’

compileJava.options.encoding = ‘UTF-8’

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

mainClassName = ‘com.jpaulmorrison.graphics.DrawFBP’

nexusStaging {
username = ossrhUser
password = ossrhPassword

}

repositories {
mavenCentral()
}

dependencies {
implementation (‘math.geom2d:javaGeom:0.11.1’)
implementation (‘javax.help:javahelp:2.0.05’)
}

// if going to Maven, have to suppress jar

jar {
manifest {
attributes ‘Implementation-Title’: ‘DrawFBP’, ‘Implementation-Version’: archiveVersion,
“Class-Path”: configurations.compileClasspath.collect { it.getName() }.join(’ ‘),
‘Main-Class’ : mainClassName
}
//manifest {
// attributes ‘Implementation-Title’: ‘DrawFBP with javaGeom and JavaHelp jar files’,
// ‘Implementation-Version’: archiveVersion,
// “Class-Path”: configurations.compileClasspath.collect { it.getName() }.join(’ '),
// ‘Main-Class’: ‘com.jpaulmorrison.graphics.DrawFBP’
// }

//baseName = project.name + '-all'
archiveBaseName = project.name
from sourceSets.main.output       
  
dependsOn configurations.compileClasspath

from {       
  configurations.compileClasspath.findAll {  it.name.endsWith('jar')  }.collect {   zipTree(it)  }           
}

exclude('math/geom2s/**')
exclude('math/geom3d/**')
exclude('math/geom2s/**')
exclude('math/utils/**')
exclude('math/package/html')
exclude('com/seisw/util/geom/**')

}

if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addBooleanOption(‘Xdoclint:none’, true)
}
}

ext {
snapshotPublicationRepository = “https://oss.sonatype.org/content/repositories/snapshots/
releasePublicationRepository = “https://oss.sonatype.org/service/local/staging/deploy/maven2/

mainClassName = ‘com.jpaulmorrison.graphics.DrawFBP’
ossrhUser = project.hasProperty(‘ossrhUser’) ? project.property(‘ossrhUser’) : “”
osshrPassword = project.hasProperty(‘osshrPassword’) ? project.property(‘osshrPassword’) : “”

}

ext {
snapshotPublicationRepository = “https://oss.sonatype.org/content/repositories/snapshots/
releasePublicationRepository = “https://oss.sonatype.org/service/local/staging/deploy/maven2/

mainClassName = ‘com.jpaulmorrison.graphics.DrawFBP’
ossrhUser = project.hasProperty(‘ossrhUser’) ? project.property(‘ossrhUser’) : “”
osshrPassword = project.hasProperty(‘osshrPassword’) ? project.property(‘osshrPassword’) : “”

}

// Used to generate initial maven-dir layout
task “create-dirs” {
doLast {
description = “Create default maven directory structure”
//}
// {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
}

task javadocJar(type: Jar) {
classifier = ‘javadoc’
from javadoc
}

task sourcesJar(type: Jar) {
classifier = ‘sources’
from sourceSets.main.allSource
}

artifacts {
archives javadocJar,sourcesJar
}

publishing {

publications {
    mavenJava(MavenPublication) {
      
        artifactId = 'drawfbp'
        from components.java
        versionMapping {
            usage('java-api') {
                fromResolutionOf('runtimeClasspath')
            }
            usage('java-runtime') {
                fromResolutionResult()
            }
        }
        pom {
            name = 'DrawFBP'
            description = 'Diagramming Tool for Flow-Based Programming'
             // groupId 'com.jpaulmorrison'
            // packaging 'jar'
     
           url = 'https://github.com/jpaulm/drawfbp'
            
            //properties = [
            //    myProp: "value",
            //    "prop.with.dots": "anotherValue"
           // ]
            licenses {
                license {
                    name = 'The Apache License, Version 2.0'
                    url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                }
                license {
                    name = 'GNU Lesser General Public License, Version 3.0'
                   url = 'https://www.gnu.org/licenses/lgpl-3.0.txt'
                 }
            }
            
      developers {
       developer {
         id = 'jpaulmorr'
         name = 'John Paul Rodker Morrison (Software architect/developer)'
         email = 'jpaulmorr@gmail.com'
       }
       developer {
         id  = 'bobcorrick'
         name =  'Bob Corrick (Software architect/developer)'
         email = 'bobcorrick@outlook.com'
       }
     }
    
    //version '2.19.2'
    
            scm {
      connection = 'scm:git:git:https://github.com/jpaulm.git'
      developerConnection = 'scm:git:ssh:https://github.com/jpaulm.git'
      url = 'https://github.com/jpaulm.git'
    }
        }
    }
}
repositories {
    maven {
       
        def releasesRepoUrl = "$buildDir/repos/releases"
        def snapshotsRepoUrl = "$buildDir/repos/snapshots"
        url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
    
        
        println(releasesRepoUrl)
        println(snapshotsRepoUrl)
        println(url)
  
   credentials { 
      username = ossrhUser
      password = ossrhPassword
   }
 
}

}

signing {
sign publishing.publications.mavenJava
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption(‘html5’, true)
}
}

}

I removed credentials, and the “gradle publish” ran successfully. However it no longer seems to do the upload to Nexus Staging Repository automatically. Can I do this with Gradle 6.2? TIA