You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by GitBox <gi...@apache.org> on 2022/07/20 08:39:40 UTC

[GitHub] [felix-dev] kwin opened a new pull request, #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor

kwin opened a new pull request, #169:
URL: https://github.com/apache/felix-dev/pull/169

   improve debug logging when update is needed
   add IT


-- 
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: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] jbonofre commented on pull request #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor

Posted by GitBox <gi...@apache.org>.
jbonofre commented on PR #169:
URL: https://github.com/apache/felix-dev/pull/169#issuecomment-1196341882

   I'm reviewing it right now. I will probably merge with squash to have a single commit.


-- 
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: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] kwin commented on a diff in pull request #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor

Posted by GitBox <gi...@apache.org>.
kwin commented on code in PR #169:
URL: https://github.com/apache/felix-dev/pull/169#discussion_r925900770


##########
tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java:
##########
@@ -428,15 +428,27 @@ private boolean isMetadataUpToDate(File outputFile, MavenProject project)
             // generated last?
             Path cacheData = getIncrementalDataPath(project);
             if(!Files.isRegularFile(cacheData)) {
+                getLog().debug("No cache data file found at '" + cacheData + "', generating manifest.");
                 return false;
             }
             long manifestLastModified = lastModified(cacheData);
             while (project != null)
             {
-                Path pom = project.getFile().toPath();
-                if (manifestLastModified < lastModified(pom))
-                {
-                    return false;
+                if (project.getFile() != null) {
+                    Path pom = project.getFile().toPath();
+                    if (manifestLastModified < lastModified(pom))
+                    {
+                        getLog().debug("File at  '" + pom + "' newer than cache data file, generating manifest.");
+                        return false;
+                    }
+                } else {
+                    if (project.getVersion().endsWith("-SNAPSHOT")) { // is it mutable?
+                        getLog().debug("pom.xml file not found for SNAPSHOT project'" + project + "', assume modification.");
+                        return false;
+                    } else {
+                        getLog().debug("pom.xml file not found for non-SNAPSHOT project'" + project + "', assume no modification.");
+                        break;

Review Comment:
   Ok, done in https://github.com/apache/felix-dev/pull/169/commits/430c03299f3a747dbcc629e32f9d1f7addf7a32f.



-- 
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: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] HannesWell commented on a diff in pull request #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor

Posted by GitBox <gi...@apache.org>.
HannesWell commented on code in PR #169:
URL: https://github.com/apache/felix-dev/pull/169#discussion_r925893092


##########
tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java:
##########
@@ -428,15 +428,27 @@ private boolean isMetadataUpToDate(File outputFile, MavenProject project)
             // generated last?
             Path cacheData = getIncrementalDataPath(project);
             if(!Files.isRegularFile(cacheData)) {
+                getLog().debug("No cache data file found at '" + cacheData + "', generating manifest.");
                 return false;
             }
             long manifestLastModified = lastModified(cacheData);
             while (project != null)
             {
-                Path pom = project.getFile().toPath();
-                if (manifestLastModified < lastModified(pom))
-                {
-                    return false;
+                if (project.getFile() != null) {
+                    Path pom = project.getFile().toPath();
+                    if (manifestLastModified < lastModified(pom))
+                    {
+                        getLog().debug("File at  '" + pom + "' newer than cache data file, generating manifest.");
+                        return false;
+                    }
+                } else {
+                    if (project.getVersion().endsWith("-SNAPSHOT")) { // is it mutable?
+                        getLog().debug("pom.xml file not found for SNAPSHOT project'" + project + "', assume modification.");
+                        return false;
+                    } else {
+                        getLog().debug("pom.xml file not found for non-SNAPSHOT project'" + project + "', assume no modification.");
+                        break;

Review Comment:
   That is true for jars one fetches from Maven-Central, but if you are in the IDE and are going back and forth in the git-history weird scenarios can happen. Therefore I think it would be better to just continue. 



-- 
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: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] HannesWell commented on a diff in pull request #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor

Posted by GitBox <gi...@apache.org>.
HannesWell commented on code in PR #169:
URL: https://github.com/apache/felix-dev/pull/169#discussion_r925412592


##########
tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java:
##########
@@ -428,15 +428,27 @@ private boolean isMetadataUpToDate(File outputFile, MavenProject project)
             // generated last?
             Path cacheData = getIncrementalDataPath(project);
             if(!Files.isRegularFile(cacheData)) {
+                getLog().debug("No cache data file found at '" + cacheData + "', generating manifest.");
                 return false;
             }
             long manifestLastModified = lastModified(cacheData);
             while (project != null)
             {
-                Path pom = project.getFile().toPath();
-                if (manifestLastModified < lastModified(pom))
-                {
-                    return false;
+                if (project.getFile() != null) {
+                    Path pom = project.getFile().toPath();
+                    if (manifestLastModified < lastModified(pom))
+                    {
+                        getLog().debug("File at  '" + pom + "' newer than cache data file, generating manifest.");

Review Comment:
   What about "POM-file at..."? I think the meaning is even then correct if it is not a pom.xml but e.g. a polyglot POM file.



##########
tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java:
##########
@@ -428,15 +428,27 @@ private boolean isMetadataUpToDate(File outputFile, MavenProject project)
             // generated last?
             Path cacheData = getIncrementalDataPath(project);
             if(!Files.isRegularFile(cacheData)) {
+                getLog().debug("No cache data file found at '" + cacheData + "', generating manifest.");
                 return false;
             }
             long manifestLastModified = lastModified(cacheData);
             while (project != null)
             {
-                Path pom = project.getFile().toPath();
-                if (manifestLastModified < lastModified(pom))
-                {
-                    return false;
+                if (project.getFile() != null) {
+                    Path pom = project.getFile().toPath();
+                    if (manifestLastModified < lastModified(pom))
+                    {
+                        getLog().debug("File at  '" + pom + "' newer than cache data file, generating manifest.");
+                        return false;
+                    }
+                } else {
+                    if (project.getVersion().endsWith("-SNAPSHOT")) { // is it mutable?
+                        getLog().debug("pom.xml file not found for SNAPSHOT project'" + project + "', assume modification.");
+                        return false;
+                    } else {
+                        getLog().debug("pom.xml file not found for non-SNAPSHOT project'" + project + "', assume no modification.");
+                        break;

Review Comment:
   Why not continue to search the parent-hierarchy in this case?
   



-- 
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: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] asfgit closed pull request #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor
URL: https://github.com/apache/felix-dev/pull/169


-- 
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: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] kwin commented on a diff in pull request #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor

Posted by GitBox <gi...@apache.org>.
kwin commented on code in PR #169:
URL: https://github.com/apache/felix-dev/pull/169#discussion_r925486018


##########
tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java:
##########
@@ -428,15 +428,27 @@ private boolean isMetadataUpToDate(File outputFile, MavenProject project)
             // generated last?
             Path cacheData = getIncrementalDataPath(project);
             if(!Files.isRegularFile(cacheData)) {
+                getLog().debug("No cache data file found at '" + cacheData + "', generating manifest.");
                 return false;
             }
             long manifestLastModified = lastModified(cacheData);
             while (project != null)
             {
-                Path pom = project.getFile().toPath();
-                if (manifestLastModified < lastModified(pom))
-                {
-                    return false;
+                if (project.getFile() != null) {
+                    Path pom = project.getFile().toPath();
+                    if (manifestLastModified < lastModified(pom))
+                    {
+                        getLog().debug("File at  '" + pom + "' newer than cache data file, generating manifest.");
+                        return false;
+                    }
+                } else {
+                    if (project.getVersion().endsWith("-SNAPSHOT")) { // is it mutable?
+                        getLog().debug("pom.xml file not found for SNAPSHOT project'" + project + "', assume modification.");
+                        return false;
+                    } else {
+                        getLog().debug("pom.xml file not found for non-SNAPSHOT project'" + project + "', assume no modification.");
+                        break;

Review Comment:
   If it is a release version all its parents must be non-SNAPSHOTS as well. A change would require a version change which would propagate down to all ancestor poms



-- 
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: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] kwin commented on a diff in pull request #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor

Posted by GitBox <gi...@apache.org>.
kwin commented on code in PR #169:
URL: https://github.com/apache/felix-dev/pull/169#discussion_r925528093


##########
tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java:
##########
@@ -428,15 +428,27 @@ private boolean isMetadataUpToDate(File outputFile, MavenProject project)
             // generated last?
             Path cacheData = getIncrementalDataPath(project);
             if(!Files.isRegularFile(cacheData)) {
+                getLog().debug("No cache data file found at '" + cacheData + "', generating manifest.");
                 return false;
             }
             long manifestLastModified = lastModified(cacheData);
             while (project != null)
             {
-                Path pom = project.getFile().toPath();
-                if (manifestLastModified < lastModified(pom))
-                {
-                    return false;
+                if (project.getFile() != null) {
+                    Path pom = project.getFile().toPath();
+                    if (manifestLastModified < lastModified(pom))
+                    {
+                        getLog().debug("File at  '" + pom + "' newer than cache data file, generating manifest.");

Review Comment:
   Done in https://github.com/apache/felix-dev/pull/169/commits/4918d1fe5efdac4d1ca93b46b63f6983ce433c2a.



-- 
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: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] HannesWell commented on a diff in pull request #169: FELIX-6548 prevent NPE in "manifest" goal with parent outside reactor

Posted by GitBox <gi...@apache.org>.
HannesWell commented on code in PR #169:
URL: https://github.com/apache/felix-dev/pull/169#discussion_r925923989


##########
tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java:
##########
@@ -428,15 +428,27 @@ private boolean isMetadataUpToDate(File outputFile, MavenProject project)
             // generated last?
             Path cacheData = getIncrementalDataPath(project);
             if(!Files.isRegularFile(cacheData)) {
+                getLog().debug("No cache data file found at '" + cacheData + "', generating manifest.");
                 return false;
             }
             long manifestLastModified = lastModified(cacheData);
             while (project != null)
             {
-                Path pom = project.getFile().toPath();
-                if (manifestLastModified < lastModified(pom))
-                {
-                    return false;
+                if (project.getFile() != null) {
+                    Path pom = project.getFile().toPath();
+                    if (manifestLastModified < lastModified(pom))
+                    {
+                        getLog().debug("File at  '" + pom + "' newer than cache data file, generating manifest.");
+                        return false;
+                    }
+                } else {
+                    if (project.getVersion().endsWith("-SNAPSHOT")) { // is it mutable?
+                        getLog().debug("pom.xml file not found for SNAPSHOT project'" + project + "', assume modification.");
+                        return false;
+                    } else {
+                        getLog().debug("pom.xml file not found for non-SNAPSHOT project'" + project + "', assume no modification.");
+                        break;

Review Comment:
   Thank you.



-- 
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: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org