Bootique运行主示例时Server选项未显示问题咨询
Hey there, sorry to hear you're hitting this snag with the Bootique getting started guide. Let's walk through the most likely reasons why the Server option isn't showing up when you run your JAR, and how to fix them:
1. Check for Dependency Mismatches or Missing Modules
Bootique’s module system relies on having the right dependencies in your pom.xml. If the server module isn’t included correctly, its CLI options won’t be available:
- First, confirm your
pom.xmlincludes the server-related module (usuallybootique-jettyorbootique-jersey, depending on the guide’s version) as a compile-scoped dependency. If it’s marked astestor missing entirely, the module won’t be bundled into your fat JAR. - Double-check that your Bootique version matches what’s specified in the guide. Recent updates might have changed how server modules are packaged or activated, and the guide might not have been updated yet.
2. Validate Your Maven Build
A misconfigured build could be excluding the server module from your fat JAR:
- Run
mvn dependency:treein your project directory to see if the server module appears in your dependency tree. If it’s missing, add it explicitly to yourpom.xml. - Check your fat JAR plugin setup (like
maven-shade-pluginor Bootique’s own plugin). Make sure it’s configured to include all transitive dependencies—sometimes plugins are set to exclude certain modules by default.
3. Double-Check Your CLI Command
Sometimes the issue is just a small oversight in how you’re running the JAR:
- Try running
java -jar target/bootique-tryout-1-jar-with-dependencies.jar --helpto see the full list of available options. The Server option might be nested under a different command group (likehttpinstead ofserver) if Bootique made a recent naming change that the guide hasn’t caught up with. - If the help output still doesn’t show any server-related options, check if you need to activate the module via a configuration file. Some Bootique modules require a minimal config (like a
.ymlfile) to enable their CLI commands.
4. Verify Guide vs. Current Bootique Behavior
Since you suspect the guide might be outdated, take a quick look at Bootique’s recent release notes or GitHub repository:
- Check if the server module was renamed, moved to a different artifact, or had its CLI options restructured. If so, updating your
pom.xmlto match the latest artifact IDs should resolve the issue. - If you confirm the guide is out of sync, consider opening an issue in the Bootique repo linking your reproducible project—maintainers will appreciate the heads-up to update the documentation.
Quick Next Steps for Your Reproducible Project
Since you’ve got a GitHub repo set up to reproduce the issue:
- Compare your
pom.xmlline-by-line with the latest example project in Bootique’s GitHub to spot any dependency or plugin differences. - If you don’t see obvious issues, try switching to the exact Bootique version that the guide recommends (even if it’s older) to see if the Server option appears—this will confirm if the problem is due to a recent Bootique change.
内容的提问来源于stack exchange,提问作者Rubin Simons

