Implement version conflict resolution for CobiGen template sets #1697
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
CobiGen was unable to handle version conflicts when multiple versions of the same template set existed in the adapted folder. This caused both template sets to be loaded and processed incrementally, overwriting each other and leading to unpredictable generation results.
Solution
Implemented automatic version conflict resolution in
TemplateSetConfigurationManagerthat:Key Features
Example
Consider two template sets in the adapted folder:
template-set1/pom.xml: versiondev-SNAPSHOT-1template-set2/pom.xml: versiondev-SNAPSHOT-1.1Before: Both template sets would be loaded, causing conflicts
After: Only
template-set2(version 1.1) is loaded, with debug log:Testing
callClassLoadingTemplateSetTestWithVersionConflictImpact
Users can now safely have multiple versions of the same template set in their adapted folder, and CobiGen will automatically use only the latest version for code generation, ensuring consistent and predictable behavior.
Fixes #1665.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
repository.sonatype.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.10/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.10/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.10 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.10/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/cobigen/cobigen org.codehaus.plexus.classworlds.launcher.Launcher clean(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.