执行mvn clean install时Quarkus构建报错:key不能为空
Hey, let's break down this error you're facing when running mvn clean install on your Quarkus project. That java.lang.IllegalArgumentException: key can't be empty message means Quarkus (or Maven) is trying to load a configuration entry where the "key" part is missing or empty—think of it like trying to set a value without saying what that value is for.
Where to look for the problem
Here are the most common places to check:
1. Your project's Quarkus config file
First head to src/main/resources/application.properties (or application.yaml if you use YAML). Look for lines that have a value but no key, like:
# Bad example: empty key before the equals sign =my-value # Or a line with just whitespace and equals =another-value
If you're using YAML, watch out for empty keys like this:
# Bad example: empty key at the top level : valid-key: some-value
Quarkus parses these config files on build, and empty keys will trigger this exact error.
2. Maven's settings.xml file
Your build command uses -s D:\env\apache-maven-3.6.3\conf\settings.xml, so check this file for empty configuration entries. Common culprits are:
<server>tags with an empty<id>(Maven needs this to identify servers)<property>tags inside<profiles>or<settings>with an empty<name>
Example of a bad server config:
<server> <id></id> <!-- Empty ID here causes issues --> <username>my-user</username> </server>
3. Quarkus Maven plugin config in pom.xml
Check your project's pom.xml for the quarkus-maven-plugin configuration. If there's a <configuration> section with an empty key-value pair, that could also trigger the error.
How to pinpoint the exact issue
Run your build with debug logging enabled to get a full stack trace—this will tell you exactly where the empty key is coming from:
mvn clean install -X
The detailed log will show the exact code path that hit the error, making it easy to trace back to the problematic config file or entry.
内容的提问来源于stack exchange,提问作者御风大世界

