Skip to content

uber-jar the frameless sample and set mainClass#3341

Open
prabhah wants to merge 4 commits intoxuxueli:masterfrom
prabhah:master
Open

uber-jar the frameless sample and set mainClass#3341
prabhah wants to merge 4 commits intoxuxueli:masterfrom
prabhah:master

Conversation

@prabhah
Copy link
Copy Markdown

@prabhah prabhah commented Nov 20, 2023

What kind of change does this PR introduce? (check at least one)

  • [] Bugfix
  • Feature
  • Code style update
  • Refactor
  • [x ] Build-related changes
  • Other, please describe:

The description of the PR:

  1. missing "mainClass" definition in the pom.xml

java -jar failed:

java -jar ./xxl-job-executor-samples/xxl-job-executor-sample-frameless/target/xxl-job-executor-sample-frameless-2.4.1-SNAPSHOT.jar
no main manifest attribute, in ./xxl-job-executor-samples/xxl-job-executor-sample-frameless/target/xxl-job-executor-sample-frameless-2.4.1-SNAPSHOT.jar

this method works,

java -cp ./xxl-job-executor-samples/xxl-job-executor-sample-frameless/target/xxl-job-executor-sample-frameless-2.4.1-SNAPSHOT.jar com.xxl.job.executor.sample.frameless.FramelessApplication
  1. didn't pack the dependence's jars to the final jar, difficult to run the sample
java -cp ./xxl-job-executor-samples/xxl-job-executor-sample-frameless/target/xxl-job-executor-sample-frameless-2.4.1-SNAPSHOT.jar com.xxl.job.executor.sample.frameless.FramelessApplication
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at com.xxl.job.executor.sample.frameless.FramelessApplication.<clinit>(FramelessApplication.java:13)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)

Other information:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant