-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Maven plugin command to generate JBang project #13538
Create Maven plugin command to generate JBang project #13538
Conversation
The CI failure seems unrelated. Also, I am wondering if this should be documented and what's the appropriate section. |
Thanks @geoandri I will have a look tomorrow :) |
cc @maxandersen, as you can see, there is a warning saying it's experimental.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice we will need the CLI pretty soon too 👍
I think we should change the outputDirectory when not specified to ${basedir}/jbang-with-quarkus
and create the directories if they don't exists.
I've got an error when using the generated project:
./jbang src/GreetingResource.java 13209-cli-command-to-create-jbang-project
Downloading JBang...
Installing JBang...
[jbang] Resolving dependencies...
[jbang] Resolving io.quarkus:quarkus-resteasy:999-SNAPSHOT...Done
[jbang] Dependencies resolved
[jbang] Building jar...
[jbang] Post build with io.quarkus.launcher.JBangIntegration
Warning: failed to load configurator: java.util.ServiceConfigurationError: org.jboss.logmanager.EmbeddedConfigurator: io.quarkus.bootstrap.logging.InitialConfigurator not a subtype
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:591)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1238)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1266)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1301)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1386)
at org.jboss.logmanager.LogContext.getConfigurator(LogContext.java:219)
at org.jboss.logmanager.LogContext.<clinit>(LogContext.java:38)
at org.slf4j.impl.Slf4jLoggerFactory.getLogger(Slf4jLoggerFactory.java:34)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
at org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher.<clinit>(DefaultRepositoryEventDispatcher.java:45)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.newInstance(DefaultServiceLocator.java:164)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstances(DefaultServiceLocator.java:139)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstance(DefaultServiceLocator.java:125)
at org.eclipse.aether.impl.DefaultServiceLocator.getService(DefaultServiceLocator.java:278)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.initService(DefaultMetadataResolver.java:119)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.newInstance(DefaultServiceLocator.java:169)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstances(DefaultServiceLocator.java:139)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstance(DefaultServiceLocator.java:125)
at org.eclipse.aether.impl.DefaultServiceLocator.getService(DefaultServiceLocator.java:278)
at org.apache.maven.repository.internal.DefaultVersionResolver.initService(DefaultVersionResolver.java:108)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.newInstance(DefaultServiceLocator.java:169)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstances(DefaultServiceLocator.java:139)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstance(DefaultServiceLocator.java:125)
at org.eclipse.aether.impl.DefaultServiceLocator.getService(DefaultServiceLocator.java:278)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.initService(DefaultRepositorySystem.java:143)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.newInstance(DefaultServiceLocator.java:169)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstances(DefaultServiceLocator.java:139)
at org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstance(DefaultServiceLocator.java:125)
at org.eclipse.aether.impl.DefaultServiceLocator.getService(DefaultServiceLocator.java:278)
at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.newRepositorySystem(BootstrapMavenContext.java:662)
at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.getRepositorySystem(BootstrapMavenContext.java:223)
at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.resolveRemoteRepos(BootstrapMavenContext.java:476)
at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.getRemoteRepositories(BootstrapMavenContext.java:231)
at io.quarkus.bootstrap.JBangBuilderImpl.postBuild(JBangBuilderImpl.java:27)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at io.quarkus.launcher.JBangIntegration.postBuild(JBangIntegration.java:77)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at dev.jbang.IntegrationManager.runIntegration(IntegrationManager.java:94)
at dev.jbang.cli.BaseBuildCommand.buildJar(BaseBuildCommand.java:206)
at dev.jbang.cli.BaseBuildCommand.build(BaseBuildCommand.java:129)
at dev.jbang.cli.Run.prepareArtifacts(Run.java:70)
at dev.jbang.cli.Run.doCall(Run.java:59)
at dev.jbang.cli.BaseCommand.call(BaseCommand.java:80)
at dev.jbang.cli.BaseCommand.call(BaseCommand.java:12)
at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
at picocli.CommandLine.access$1200(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
at picocli.CommandLine.execute(CommandLine.java:2058)
at dev.jbang.Main.main(Main.java:14)
[jbang] [ERROR] Issue running postBuild()
[jbang] Run with --verbose for more details
ahh this is the error you were talking about @geoandri.. @maxandersen didn't we fix it already? |
Hmm. Let me release new jbang. Wasn't sure it was needed. Looks like it is. |
@maxandersen maybe we need to update this also (and the |
yeah, remember when I said I wasn't a fan of us hardcoding that ? :) |
jbang 0.55.2 is out now and here I get this:
so here it works. issue was a mysterious collison of jboss logging that haven't bee a problem for a year...but now avoided by jbang not shadowing it. |
@geoandri could you update the jbang wrappers (by generating new ones) and make the requested output directory change? |
Thanks for looking at this @ia3andy .
means . Are you referring to |
@geoandri I mean you need to update those files (they are generated following those instructions https://github.com/jbangdev/jbang#wrapper-install, you need to udpate jbang first):
|
@maxandersen Could we make them always use the latest? |
Oh, ok got it, in order to have a working generated JBang project. |
983c950
to
d877882
Compare
Hi @ia3andy, I have pushed the changes. There is a failure in the CI which seems unrelated. |
@geoandri I don't see the update jbang wrappers in the changes? The generated jbang project still doesn't work for that reason.. Also, could you add a message like this to display info about the generated project: invocation.log().info("-----------");
if (!extensionsToAdd.isEmpty()) {
invocation.log().info("selected extensions: \n"
+ extensionsToAdd.stream().map(e -> "- " + e.getGroupId() + ":" + e.getArtifactId() + "\n")
.collect(Collectors.joining()));
}
final CodestartProjectDefinition projectDefinition = getCatalog(invocation.getPlatformDescriptor()).createProject(input);
projectDefinition.generate(projectDir);
invocation.log().info("\n-----------\n" + MessageIcons.NOOP_ICON + " "
+ projectDefinition.getRequiredCodestart(CodestartType.PROJECT).getName()
+ " project has been successfully generated in:\n--> "
+ projectDir.toString() + "\n-----------"); |
I misunderstood, I thought that they were already updated in the latest master because I rebased my branch against the latest master and it worked.
I will update jbang and push the changes. |
b325c03
to
54a3162
Compare
Hi @ia3andy , I have addressed you comments and pushed latest changes. A failure in CI again that seems unrelated. Thanks |
I still get this error :-/
@maxandersen @geoandri do you get it too? |
@geoandri ok I needed a It's weird that the CI has been failing on the same one multiple time, can you rebase on latest master? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good piece of work!
I hope you will also provide a PR to plug this to the soon coming Quarkus CLI https://github.com/quarkusio/quarkus/tree/master/devtools/cli/src/main/java/io/quarkus/cli
Also you could add a picocli jbang example: #13208
Thanks @ia3andy , I will have a look. |
Creates a new command to generate a Quarkus JBang project (e.g.
mvn io.quarkus:quarkus-maven-plugin:1.9.2.Final:create-jbang
).Supports setting extensions and JBang wrapper inclusion in the generated project.
Closes #13209