SpectatorPlus

SpectatorPlus

34.1k Downloads

Maven repository

AmauryCarrade opened this issue · 41 comments

commented

This project don't have an automated Maven repository.
I used to manually (!) update a repository on my server, but it is pretty outdated.

Do you want to install a repository manager on your server, like Artifactory? Or to use my Artifactory instance? Or nothing, but without that it's hard to use the API.

commented

Good point. I'll see about it soon, may not have time tonight to finish it.

commented

(Is there an apt-source I can use so I can auto-update?) My VPS has Debian 8.

commented

(I don't think so.)

commented

Artifactory setup complete. Have a look: https://ci.pgmann.cf/maven/

commented

What should I actually archive in artifactory? Just the .jar or is the pom.xml needed as well?

commented

You should archive the .jar and the associated .pom. There is an Artifactory plugin for Jenkins to do that :) .

commented

On the side: how did you removed the /artifactory/ from the URL? I want my repository URL to be maven.carrade.eu, but it is maven.carrade.eu/artifactory currently :c .

commented

You rename the .war file (I installed tomcat first, then dropped
artifactory.war into /var/lib/tomcat8/webapps/). You can name it anything
(e.g. maven.war) Make sure you rename the other folder with the same name
in the webapps folder.

On Mon, 11 Jan 2016 10:09 pm Amaury Carrade [email protected]
wrote:

On the side: how did you removed the /artifactory/ from the URL? I want
my repository URL to be maven.carrade.eu, but it is
maven.carrade.eu/artifactory currently :c .


Reply to this email directly or view it on GitHub
#62 (comment)
.

commented

Oh yeah, and calling it ROOT.war and ROOT (delete old ROOT folder) will
make it have no path (removes the word artifactory)

On Tue, 12 Jan 2016 9:46 am Peter Gordon [email protected] wrote:

You rename the .war file (I installed tomcat first, then dropped
artifactory.war into /var/lib/tomcat8/webapps/). You can name it anything
(e.g. maven.war) Make sure you rename the other folder with the same name
in the webapps folder.

On Mon, 11 Jan 2016 10:09 pm Amaury Carrade [email protected]
wrote:

On the side: how did you removed the /artifactory/ from the URL? I want
my repository URL to be maven.carrade.eu, but it is
maven.carrade.eu/artifactory currently :c .


Reply to this email directly or view it on GitHub
#62 (comment)
.

commented

Can you confirm it's working now? (Haven't got snapshot versioning working yet)

commented

It's working on my side currently. I got a lot of warnings related to the HTTPS certificate, but it works well.

EDIT: it doesn't work on Jenkins, the server used a cached old version instead. You have certificate problems. It worked locally because I have SPlus B3.0 in my local repository.

commented

The pom.xml is now archived in artifactory as well. I have one problem - all the builds are put in the release repository instead of the snapshot one (where they should go). Any idea how to fix that?

commented

Thanks for the URL tip!


My Jenkins build is configured like this:
Jenkins build config related to Artifactory

With that, if the version is something-SNAPSHOT (e.g. zLib 0.99-SNAPSHOT), the build is archived in the snapshots repositories; else, in the relases one.

commented

Finally I can update my dependencies o/

commented

(you might want to wait a bit, switching repo names about ;) )

commented
commented

Hmm... I see you have Java 1.8 installed on your server, but your Jenkins is using 1.7... it may be using a different, old keystore that doesn't have my cert's root in it...

commented

You could try using this to debug it...

https://confluence.atlassian.com/display/KB/Unable+to+Connect+to+SSL+Services+due+to+PKIX+Path+Building+Failed

Not sure how you'd execute that command as jenkins though. Maybe in a Jenkins job pre-step?

commented

Is this still not working @AmauryCarrade? I'm using the snapshot repository now since this commit: 3b230fe

commented

I think this can finally be closed, if you can confirm it working with UHPlugin please @AmauryCarrade? Note the repo path has changed - see the README file for details.

commented

Maven/Jenkins is still complaining about invalid certificates.

This is probably the cause of #64 as the build server is still using an old cached build, if the API changed. Except if this issue's author compiled UHPlugin locally. Nop.

Hmm... I see you have Java 1.8 installed on your server, but your Jenkins is using 1.7... it may be using a different, old keystore that doesn't have my cert's root in it...

Nop, the same file is used by both Java 7 and 8.

commented

Probably.

commented

You should update the README, as it suggests using the LATEST version.

commented

Will do tomorrow. (On phone)

commented

Please try querying your Java trust store for the root certificate used to sign my cert.

keytool -list -keystore /etc/ssl/certs/java/cacerts | grep dst
Enter keystore password:  changeit

Expected output:

debian:dst_root_ca_x3.pem, 30-Nov-2015, trustedCertEntry,
debian:dst_aces_ca_x6.pem, 30-Nov-2015, trustedCertEntry,
commented
debian:dst_root_ca_x3.pem, 8 sept. 2014, trustedCertEntry, 
debian:dst_aces_ca_x6.pem, 8 sept. 2014, trustedCertEntry, 

A bit old indeed. But I manually added your certificate to the store (following this), without success.

commented

Would be interested to see if a local build of UHPlugin would work...

commented

It works locally.

commented

Wow, ok... How about the VM command line?

commented

Found it. Jenkins uses it's own JRE, not the system-wide JRE 7. I linked the cacerts file of this JRE to /etc/ssl/certs/java/cacerts and now it (really) works.

commented

Ah, very nice! Glad it worked in the finish up. Yay we fixed an issue!

commented

Hang on, are you sure it's using the build from my maven repo?

[INFO] Building UHCReloaded 1.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://mvn.pgmann.cf/org/bukkit/bukkit/1.8.3-R0.1-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: https://mvn.pgmann.cf/fr/zcraft/zlib/0.99-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: https://mvn.pgmann.cf/com/pgcraft/SpectatorPlus/maven-metadata.xml
[INFO] Downloading: https://mvn.pgmann.cf/com/comphenix/protocol/ProtocolLib-Parent/v3-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: https://mvn.pgmann.cf/com/comphenix/executors/BukkitExecutors/1.1-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: https://mvn.pgmann.cf/org/mcstats/bukkit/metrics-lite/R8-SNAPSHOT/maven-metadata.xml

All these URLs return 404, including the actual one for SpectatorPlus. Maybe I should be using https://mvn.pgmann.cf/repository/maven-snapshots/... instead? That returns the expected file.

commented

I modified the build as mentioned in the commit above and it works locally, even when I delete the local repository or with the -U flag. Waiting for the Jenkins build to finish...

commented

Yep, this time it seems to be fine:

[INFO] Downloading: https://mvn.pgmann.cf/repository/maven-snapshots/com/pgcraft/SpectatorPlus/B3.0-SNAPSHOT/SpectatorPlus-B3.0-20160503.161555-5.pom
[INFO] Downloaded: https://mvn.pgmann.cf/repository/maven-snapshots/com/pgcraft/SpectatorPlus/B3.0-SNAPSHOT/SpectatorPlus-B3.0-20160503.161555-5.pom (4 KB at 37.5 KB/sec)
[INFO] Downloading: https://mvn.pgmann.cf/repository/maven-snapshots/com/pgcraft/SpectatorPlus/B3.0-SNAPSHOT/SpectatorPlus-B3.0-20160503.161555-5.jar
[INFO] Downloaded: https://mvn.pgmann.cf/repository/maven-snapshots/com/pgcraft/SpectatorPlus/B3.0-SNAPSHOT/SpectatorPlus-B3.0-20160503.161555-5.jar

But you broke the LATEST version, I had to explicitly set it. It's not a problem this said.

commented

Great! I assume it's because Nexus doesn't support LATEST?

commented

I updated the README and also added an API Usage section. Would you please update the line of code which is commented out to show the correct, non-deprecated usage? (Last line of code snippet in the file)

commented

(@AmauryCarrade, please log in to my Jenkins and I can now give you access to build SpectatorPlus on demand - just need to make sure of the username!)

(Slightly off-topic)

commented

(Done. It's the same username as GitHub.)

commented

(There, you have read, build and workspace access to SpectatorPlus and Spigot)

commented

@AmauryCarrade: Another change (sorry!). Remove /repository/maven-snapshots from the URL to leave just https://mvn.pgmann.cf/ as the repo URL. This should be the last change necessary for a while, I hope!

[Technical details: Nexus was using ~1GB of RAM after running a while. So I'm using Jenkins as a Maven Repository Server now.]

commented

@AmauryCarrade ping, see above.