Open gastaldi opened 3 years ago
I have also tried with
//DEPS https://github.com/gastaldi/quarkus-registry-generator
but got the same error:
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.github.gastaldi:quarkus-registry-generator:jar:-SNAPSHOT in mavencentral (https://repo1.maven.org/maven2/)
I can confirm at least that the same happens to me locally. It also seems we don't have any integration tests for this? So right now I have no idea if this is broken or if there's some problem with this particular code.
Btw manually adding //REPOS jitpack mavencentral
doesn't help.
The artifact does exist on JitPack: https://jitpack.io/#gastaldi/quarkus-registry-generator/-SNAPSHOT
Edit: sorry, that's wrong, it does NOT exist. (The page always exists, but no build has been done)
If I remove the MavenCentral repo (and the picocli dep) the error is:
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.github.gastaldi:quarkus-registry-generator:jar:-SNAPSHOT in jitpack (https://jitpack.io/)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:369)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
...
@gastaldi can you perhaps try a quick test by setting up a dummy project with this:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
and
<dependency>
<groupId>com.github.gastaldi</groupId>
<artifactId>quarkus-registry-generator</artifactId>
<version>-SNAPSHOT</version>
</dependency>
To see if that works? That would at least rule out any problems with the service itself...
@quintesse that fails with:
[ERROR] Failed to execute goal on project points: Could not resolve dependencies for project com.example:points:jar:1.0.0-SNAPSHOT: Could not find artifact com.github.gastaldi:quarkus-registry-generator:jar:-SNAPSHOT in jitpack.io (https://jitpack.io) -> [Help 1]
So perhaps it's a problem with the service then? 🤔
com.github.gastaldi:quarkus-registry-generator:HEAD-SNAPSHOT
is not the way jitpack names its builds.
Its com.github.gastaldi:quarkus-registry-generator:HEAD
AND you then must add jitpack.io manually as a repo (i.e. //REPOS jitpack
)
From sources references would be to use //DEPS https://github.com/gastaldi/quarkus-registry-generator
but that doesn't work either for some reason. I have a feeling jitpack changed their approach so there is no longer a way to genericially refer to the "HEAD" build one must use master or main explicitly ;/
so you would need to use //DEPS https://github.com/gastaldi/quarkus-registry-generator/tree/main#:SNAPSHOT
which works but sucks as the whole idea was to not require to have to deal with exact versions before you really need it.
One thing I noticed is different from this repo and lets say jbangdev/jbang is that quarkus-registry-generator has a build listed named HEAD
- I wonder if that somehow breaks HEAD-SNAPSHOT
fetches on the jitpack.io side ? at least using com.github.jbangdev:jbang:HEAD-SNAPSHOT
seem to work for me ?
correction, it seems like it works but eventually it fails too...so build is triggered but no longer seem to be able to complete/return.
I'm 98% convinced jitpack.io changed behaviour here. Unfortunately they don't seem to respond on gitter, twitter nor support lately but I've given it a go via their support/feedback from on their website.
Side note: The feature is documented at https://www.jbang.dev/documentation/guide/latest/dependencies.html#using-links-to-git-sources.
AND you then must add jitpack.io manually as a repo (i.e. //REPOS jitpack)
This needs to be added to the documentation
When just following the documentation:
I have following java file:
//DEPS https://github.com/koppor/heylogs/tree/add-git-diff-check
public class heylogs {
public static void main(String... args) throws Exception {
nbbrd.heylogs.cli.HeylogsCommand.main(args);
}
}
jbang outputs:
> jbang .github\heylogs.java -g
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
[jbang] Resolving dependencies...
[jbang] com.github.koppor:heylogs:add-git-diff-check
[jbang] [ERROR] Could not resolve dependencies: Could not find artifact com.github.koppor:heylogs:jar:add-git-diff-check in central (https://repo1.maven.org/maven2/)
[jbang] Run with --verbose for more details
When ading //REPOS jitpack
I have following java file:
//REPOS jitpack
//DEPS https://github.com/koppor/heylogs/tree/add-git-diff-check
public class heylogs {
public static void main(String... args) throws Exception {
nbbrd.heylogs.cli.HeylogsCommand.main(args);
}
}
jbang outputs:
> jbang .github\heylogs.java -g
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
[jbang] Resolving dependencies...
[jbang] com.github.koppor:heylogs:add-git-diff-check
[jbang] [ERROR] Could not resolve dependencies: Could not find artifact com.github.koppor:heylogs:jar:add-git-diff-check in jitpack (https://jitpack.io/)
[jbang] Run with --verbose for more details
All NOT working here.
I wonder why :jar
is magically added to the dependency
:jar is the canonical naming of jar artifacts.
Jitpack is quite flakey. My guess is we are still hit with them no longer dealing with HEAD as uniform way to get latest main branch no matter if master or main used for name.
If that's the case add the branch name explicitly.
In my case: The constructed URL returns "Tag or commit 'add-git-diff-check' not found. Rechecking.".
I tried with the commit id, also not working.
I tried with a freshly created tag.
Now, I get
[jbang] [0:348] Resolving dependencies...
[jbang] [0:421] com.github.koppor:heylogs:test
[jbang] [10:721] org.junit:junit-bom:5.10.0
[jbang] [10:724] com.github.nbbrd.java-service-util:java-service-bom:1.7.0
[jbang] [11:837] Deleting folder C:\Users\koppor\.jbang\cache\jars\heylogs.java.1ddf3d869d7764bab2321e907dc09c8e44f88abcc42347fbc7cb8d39aeef5395\classes
[jbang] [11:840] Deleting folder C:\Users\koppor\.jbang\cache\jars\heylogs.java.1ddf3d869d7764bab2321e907dc09c8e44f88abcc42347fbc7cb8d39aeef5395\generated
[jbang] [11:841] [ERROR] Could not resolve dependencies: Could not find artifact com.github.koppor:heylogs:jar:test in jitpack (https://jitpack.io/)
dev.jbang.cli.ExitException: Could not resolve dependencies: Could not find artifact com.github.koppor:heylogs:jar:test in jitpack (https://jitpack.io/)
That error message could be more detailed. Reason: it seems, jbang could resolve the root dependency, but has issues with some child dependencies... I would like to know, which one failed.
OK, the error is on my side, because I want to include a sub-project in jitpack, which is IMHO not possible. Update: It should be possible https://stackoverflow.com/a/48024281/873282
(working version shows it - https://github.com/nbbrd/jbang-catalog/blob/master/heylogs.java)
For the googlers some links:
test
is a tag here, not a branch name)-SNAPSHOT
to branchesI got it running w/ jitpack dependency. "RTFM of jitpack.io" is the answer for me.
jbang --repos jitpack,central -m nbbrd.heylogs.cli.HeylogsCommand com.github.koppor.heylogs:heylogs-cli:jitpack-SNAPSHOT --help
Not sure how to do with GitHub links and sub projects.
I am using JBang 0.78.0 and followed the Using links to Git sources guide to use a dependency from my GitHub repository, like in the following:
However it fails with: