Can I use the new plugin DSL with a Nexus proxy repository?

The docs aren’t really clear on whether or not the incubating plugin DSL can be used with a proxied repository in Artifactory, Nexus, etc…

I’m try to proxy https://plugins.gradle.org/m2/ as described in this thread, but all I get are 404 errors for the marker artifacts.

This comment says to use the old style plugin config, but it’s over a year old. Do I still need to use the old style?

2 Likes

I would also like to know this, I suspect we have to use the old buildscript closure instead or maybe we can use the buildscript closure to set the repository then the new plugins closure will use it. I don’t know yet, I should know soon though.

There are no marker artifacts in that repository yet, so you currently can’t proxy the plugin portal for use with the new DSL. The old answer to use the buildscript block is unfortunately still valid.

buildscript {
    repositories {
        maven {
            url 'http://nexus3-host:8081/repository/maven-public/'
        }
    }
}

plugins {
    id 'net.ltgt.apt' version '0.9'
    id 'com.github.hierynomus.license' version '0.13.1'
    id 'com.github.ben-manes.versions' version '0.13.0'
}

I confirmed this hybrid works with a nexus3 proxy

And honestly this makes the most sense, even if they were to put it inside the plugins block it wouldn’t buy much

@novaterata what you showed will still query plugins.gradle.org for the plugin metadata and will not work if that url is blocked. As I said before, mirroring the plugin portal is not yet possible.

Ah ok, I misunderstood, I was only concerned with whether it pulled from
Nexus or not.