openwide-java / artifact-listener

The application behind artifact-listener.org
https://www.artifact-listener.org/
Apache License 2.0
71 stars 15 forks source link

Add JCenter support #41

Open jameswald opened 8 years ago

jameswald commented 8 years ago

https://www.artifact-listener.org currently only monitors Maven Central. Are there any plans or thoughts about adding JCenter as well? Some projects such as https://github.com/google/agera are only available on JCenter.

lalmeras commented 8 years ago

Current version may be easily customized to use JCentral by providing an alternative to MavenCentralSearchApiServiceImpl based on JCentral service : https://bintray.com/docs/api/#_maven_package_search

More work is needed to provide multi-repository (simultaneous maven central & jcenter) as it implies deep modification (configuration, database model, repository selection ui).

However, this is a good idea. I don't know if I'll get time to work on it.

spyhunter99 commented 7 years ago

This would also be awesome for me too. Specifically, I have a use case where i'd like to use artifact listeners capabilities while connected to a private nexus server that requires authentication. How does the sync job actually work? Is it a periodic cron job that hits the search api and scans for deltas? Or does it screen scrape via directory browsing to build an index then compare for deltas?

lalmeras commented 7 years ago

Currently, we use search.maven.org APIs and periodically scan the artifacts marked as followed in the database by the users. This is done in MavenCentralSearchApiArtifactVersionProviderServiceImpl and MavenCentralSearchApiServiceImpl.

There is an alternate implementation relying on raw maven repositories in MavenRepositoryArtifactVersionProviderServiceImpl (not currenlty used).

As Nexus provides REST API, I think a dedicated implementation should be easy to write. For the authentication part, if it is basic authentication, it should be easy to add this functionnality to the HTTP connection layer.

I think that it is easy to build a working prototype and I can help, but I won't be able to do it myself in the short term.

A simple thing to try is to modify the repository.sync.*.url properties in configuration.properties file (see value examples in development.properties; you should try http://user:password@host syntax for authentication), comment @Service in MavenCentralSearchApiArtifactVersionProviderServiceImpl and uncomment @Service in MavenRepositoryArtifactVersionProviderServiceImpl. If authentication is correctly handled by HTTP layer, it should work for artifact version checking.