Skip to content
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

archetype build broken with ci-friendly-maven #389

Closed
hohwille opened this issue May 6, 2021 · 2 comments · Fixed by #390
Closed

archetype build broken with ci-friendly-maven #389

hohwille opened this issue May 6, 2021 · 2 comments · Fixed by #390
Labels
bug Something isn't working

Comments

@hohwille
Copy link
Member

hohwille commented May 6, 2021

With issue #85 we introduced ci-friendly-maven also for our archetype.
Now, @suvmanda has found out a new bug with this approach that can be reproduced by the following steps:

devon java create com.demo.example
cd example
mvn clean install
cd core
mvn clean install

The first build is successful:

[INFO] example ............................................ SUCCESS [  0.588 s]
[INFO] example-api ........................................ SUCCESS [  3.981 s]
[INFO] example-core ....................................... SUCCESS [ 11.830 s]
[INFO] example-server ..................................... SUCCESS [  2.396 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

However, the second one failes with:

[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.demo:example-core >------------------------
[INFO] Building example-core 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.758 s
[INFO] Finished at: 2021-05-06T11:26:32+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project example-core: Could not resolve dependencies for project com.demo:example-core:jar:1.0.0-SNAPSHOT: Failed to collect dependencies at com.demo:example-api:jar:1.0.0-SNAPSHOT: Failed to read artifact descriptor for com.demo:example-api:jar:1.0.0-SNAPSHOT: com.demo:example:pom:${revision} was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
@hohwille hohwille added the bug Something isn't working label May 6, 2021
@hohwille hohwille added this to the release:2021.04.002 milestone May 6, 2021
@hohwille
Copy link
Member Author

hohwille commented May 6, 2021

I just looked at the installed parent POM of the project ($M2_REPO/com/demo/example/1.0.0-SNAPSHOT/example-1.0.0-SNAPSHOT.pom) and it contains:

  <version>${revision}</version>

Even worse also the POM of the API module was not flattened either ($M2_REPO/com/demo/example-api/1.0.0-SNAPSHOT/example-api-1.0.0-SNAPSHOT.pom):

  <version>${revision}</version>

So it has not been flattened and that is definetly a bug.

@hohwille
Copy link
Member Author

hohwille commented May 6, 2021

The flatten-maven-plugin is only added to dependencyManagement in our application template (archetype):

<artifactId>flatten-maven-plugin</artifactId>

However, it is never added to the build and therefore does not resolve variables such as ${revision}.
Therefore the build is entirely broken. We have to fix this quickly as this will also break projects, trainings or tutorials done on the latest archetype.
@suvmanda thanks for figuring out this bug. This is an excellent finding that we should have already found with issue #85 and PR #382. Anyhow great that we now are aware and can fix it before any harm has happened.

hohwille added a commit to hohwille/devon4j that referenced this issue May 6, 2021
@hohwille hohwille linked a pull request May 6, 2021 that will close this issue
@hohwille hohwille changed the title problem with ci-friendly-maven archetype build broken with ci-friendly-maven May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant