gnodet commented on code in PR #2380:
URL: https://github.com/apache/maven/pull/2380#discussion_r2107458470


##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java:
##########
@@ -40,28 +41,45 @@
  */
 @Singleton
 @Named
-class PomInlinerTransformer implements PomArtifactTransformer {
-    @Override
-    public InstallRequest remapInstallArtifacts(RepositorySystemSession 
session, InstallRequest request) {
-        return request;
-    }
-
-    @Override
-    public DeployRequest remapDeployArtifacts(RepositorySystemSession session, 
DeployRequest request) {
-        return request;
-    }
+class PomInlinerTransformer extends TransformerSupport {
+    protected static final Pattern PLACEHOLDER_EXPRESSION = 
Pattern.compile("\\$\\{(.+?)}");
 
     @Override
-    public void injectTransformedArtifacts(RepositorySystemSession session, 
MavenProject currentProject)
-            throws IOException {
+    public void injectTransformedArtifacts(RepositorySystemSession session, 
MavenProject project) throws IOException {
         if (!Features.consumerPom(session.getConfigProperties())) {
-            // TODO
+            try {
+                Model model = read(project.getFile().toPath());
+                String version = model.getVersion();
+                String newVersion = version;
+                int lastEnd = -1;
+                if (version != null) {
+                    Matcher m = PLACEHOLDER_EXPRESSION.matcher(version.trim());

Review Comment:
   Using the `Interpolator` would be easier and safer here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to