devonfw / cobigen

Code-based Incremental Generator
Apache License 2.0
35 stars 70 forks source link

Maven repository path caching #1617

Open EduardKrieger opened 1 year ago

EduardKrieger commented 1 year ago

Continuation of: #1476

As a CobiGen Developer, I want to cache the Maven repository path, so we can speed up the generating process. A correct caching of the Maven repository can save up to 9 seconds in a generation because the current method determineMavenRepositoryPath() in MavenUtil is time-consuming. An initial version of a cache has been implemented with the PR #1613 with https://github.com/devonfw/cobigen/blob/baa4b15b1a7e2ba8657b6015404b1cd354a53329/cobigen/cobigen-core-api/src/main/java/com/devonfw/cobigen/api/util/MavenUtil.java#L47 and also https://github.com/devonfw/cobigen/blob/baa4b15b1a7e2ba8657b6015404b1cd354a53329/cobigen/cobigen-core-api/src/main/java/com/devonfw/cobigen/api/util/MavenUtil.java#L237. This implementation has some cases that could result into errors caused by incorrect caching. As discussed in https://github.com/devonfw/cobigen/pull/1613#discussion_r1044159093_