Modify

Opened 3 years ago

Last modified 3 years ago

#16558 new defect

Github plugins not available on any maven repository

Reported by: anonymous Owned by: team
Priority: normal Milestone:
Component: Plugin Version:
Keywords: github maven nexus gradle-josm-plugin Cc: floscher

Description

I'm trying to use this plugin as a dependency to another one via manifest plugin-requires = todo attribute.

I added in gradle.properties:

plugin.requires = utilsplugin2;todoplugin

However when compiling (via gradle josm plugin (https://github.com/floscher/gradle-josm-plugin)) todo plugin cannot be found on any of these URLs:

A problem occurred configuring root project 'josm-scripting-plugin'.
> Could not resolve all files for configuration ':detachedConfiguration2'.
   > Could not find org.openstreetmap.josm.plugins:todoplugin:SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/org/openstreetmap/josm/plugins/todoplugin/SNAPSHOT/todoplugin-SNAPSHOT.pom
       - https://repo.maven.apache.org/maven2/org/openstreetmap/josm/plugins/todoplugin/SNAPSHOT/todoplugin-SNAPSHOT.jar
       - https://josm.openstreetmap.de/nexus/content/repositories/releases/org/openstreetmap/josm/plugins/todoplugin/SNAPSHOT/todoplugin-SNAPSHOT.pom
       - https://josm.openstreetmap.de/nexus/content/repositories/releases/org/openstreetmap/josm/plugins/todoplugin/SNAPSHOT/todoplugin-SNAPSHOT.jar
       - https://josm.openstreetmap.de/download/ivy.jar
       - https://josm.openstreetmap.de/download/ivy-SNAPSHOT.jar
       - https://josm.openstreetmap.de/download/ivy-snapshot-SNAPSHOT.jar
       - https://josm.openstreetmap.de/download/Archiv/ivy-snapshot-SNAPSHOT.jar
       - https://josm.openstreetmap.de/download/todoplugin.jar
       - https://josm.openstreetmap.de/download/todoplugin-SNAPSHOT.jar
       - https://josm.openstreetmap.de/download/todoplugin-snapshot-SNAPSHOT.jar
       - https://josm.openstreetmap.de/download/Archiv/todoplugin-snapshot-SNAPSHOT.jar
       - https://josm.openstreetmap.de/nexus/content/repositories/snapshots/org/openstreetmap/josm/plugins/todoplugin/SNAPSHOT/todoplugin-SNAPSHOT.pom
       - https://josm.openstreetmap.de/nexus/content/repositories/snapshots/org/openstreetmap/josm/plugins/todoplugin/SNAPSHOT/todoplugin-SNAPSHOT.jar
       - https://svn.openstreetmap.org/applications/editors/josm/dist/ivy.jar
       - https://svn.openstreetmap.org/applications/editors/josm/dist/todoplugin.jar
     Required by:
         project :


Attachments (0)

Change History (9)

comment:1 Changed 3 years ago by anonymous

Component: CorePlugin todo
Owner: changed from team to Gnonthgol

comment:2 Changed 3 years ago by Don-vip

Component: Plugin todoPlugin
Keywords: github maven nexus added
Owner: changed from Gnonthgol to team

Github plugins are not managed on Nexus.

comment:3 Changed 3 years ago by bagage

Could/Should they?

Yet, when installing a plugin from within JOSM, it is downloaded from somewhere? That somewhere location could be added as a potential source for search locations, so that all plugins are available? Or we need more than a simple jar?

comment:4 Changed 3 years ago by Don-vip

Summary: Not available on any maven repositoryGithub plugins not available on any maven repository

comment:5 Changed 3 years ago by floscher

I created https://gitlab.com/floscher/gradle-josm-plugin/issues/1 to support these plugins even when they are not in the Nexus repository.

comment:6 Changed 3 years ago by floscher

Cc: floscher added
Keywords: gradle-josm-plugin added

comment:7 Changed 3 years ago by floscher

It seems the current URLs of plugins released with GitHub releases are not going to work. Gradle will send a HEAD request when resolving dependencies, GitHub will answer with 403 Forbidden if the request is HEAD and not GET:

   > Could not resolve org.openstreetmap.josm.plugins:todo:SNAPSHOT.
     Required by:
         project :
      > Could not resolve org.openstreetmap.josm.plugins:todo:SNAPSHOT.
         > Could not get resource 'https://github.com/JOSM/todo/releases/download/v30305/todo.jar'.
            > Could not HEAD 'https://github.com/JOSM/todo/releases/download/v30305/todo.jar'. Received status code 403 from server: Forbidden

comment:8 Changed 3 years ago by Don-vip

Can't you change this behaviour of Gradle? Through a plugin or something?

comment:9 Changed 3 years ago by floscher

I could work around that and download the dependency differently, but that would come with other drawbacks, like the dependency would not be cached. See discussion at https://github.com/gradle/gradle/issues/5322 .

Probably the best solution would be to put these plugins in the Nexus repository, instead of hacking around the problem.
I currently have a pull request that allows to publish releases to Github: https://github.com/floscher/gradle-josm-plugin/pull/6 . I think I'll try to modify that to also allow to publish to a Maven repo (like https://josm.openstreetmap.de/nexus/)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to anonymous
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.