Hi all,
I have a gradle task written in Java which takes some versioned artifact deployed in nexus as an input. The important part is, I always need to have the latest version of this artifact. I still couldn’t get that part working.
I tried using com.pro.cod.news:news-archive:+
like this.
NamedDomainObjectProvider<Configuration> customConfigProvider =
project.getConfigurations().register(
FETCH_TEXT_FILE_ZIP_TASK_CONFIG,
c -> {
c.extendsFrom(project.getConfigurations().getByName("runtimeOnly"));
c.setCanBeResolved(true);
c.setCanBeConsumed(false);
});
taskProvider.configure(
task -> {
Configuration customConfig = customConfigProvider.get();
project.getDependencies()
.add(FETCH_TEXT_FILE_ZIP_TASK_CONFIG, "com.pro.cod.news:news-archive:+");
But it failed with the following error.
Could not find any matches for com.pro.cod.news:news-archive:+ as no versions of com.pro.cod.news:news-archive are available
It works fine when I use a fixed version like com.pro.cod.news:news-archive:390
.
What should I do to fetch the latest version? Any ideas are really appreciated.