fix: read_pom fallback returned both artifactId and version
When xmllint is not in PATH, the grep fallback in read_pom() captured
both <artifactId> and <version> in a single multi-line string and
returned it for every call. Concatenating it with ':' produced an
invalid Docker tag like:
test-quarkus\n1.0.0-SNAPSHOT:test-quarkus\n1.0.0-SNAPSHOT
causing 'docker build' to fail with 'invalid reference format'.
Add a third 'tag' argument to read_pom() so the fallback extracts
only the requested element, and pass 'artifactId' / 'version' from
the call sites.
Also enrich pom.xml with <name> and <description> for Maven/IDE
metadata, without changing the image identity.
Tests cover the no-xmllint path explicitly (PATH stripped to
reproduce the vm-compilador environment) and the override path.
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>test-quarkus</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Test Quarkus</name>
|
||||
<description>Sample Quarkus application exposing /status and /q/health endpoints</description>
|
||||
|
||||
<properties>
|
||||
<compiler-plugin.version>3.15.0</compiler-plugin.version>
|
||||
<maven.compiler.release>17</maven.compiler.release>
|
||||
|
||||
Reference in New Issue
Block a user