-
Notifications
You must be signed in to change notification settings - Fork 37
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
[MPIR-431] Dependency file details section: segregate Java version #47
Conversation
...ain/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
Outdated
Show resolved
Hide resolved
Yes this is the kind of conclusions I'd like to derive about the jdk versions by looking at the report, and just separating test scoped deps into its own column I agree it is too simplistic, but I think it offers more value than having only one column for all scopes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@belingueres Please rebase and let's discuss how to make this better. I think that the intentions are very noble, but the represenation of information is confusing.
I'm OK with the first two bullets. |
Yes, this is exactly what I mean. |
OK let's move on that direction. I will look how can I add this rowspan attribute using the API. |
Colspan, not rowspan in our case |
I don't get what value should span which columns. IIUC your drawing, the "Test java version" is gone. The max jdk version remains the same. The test max jdk version go into the "Java version" column (changing test scope as the first row of the table). The only value left is the non test scoped jdk version, which should be in the "Java version" column too (rowspan="4" to cover all non test scopes if present). Obviously this is not what you have in mind, so please elaborate. |
Will provide a mockup |
I will fix and simplify the javaVersionFormat variable. It does not print versions "1.0" and "1.1". Line 94 in 9209a7a
|
This confuses me:
Can you elaborate? PS: I will double check. |
@belingueres, you were partially right. Though, I tested with a loop, still missed. Fixed with Sample code: import java.text.MessageFormat;
import java.util.Locale;
public class Main {
public static void main(String[] args) {
MessageFormat javaVersionFormat =
new MessageFormat("{0,choice,0#|1.1#{0,number,0.0}|9#{0,number,0}}", Locale.ROOT);
for(double d : new double[] {0.0, 0.9,1.0, 1.1, 1.2, 1.5, 1.8, 1.9, 9, 10, 21}) {
System.out.printf("input: %s, output: %s%n", d, javaVersionFormat.format(new Object[] {d}));
}
}
} output:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IT fails for me:
[DEBUG] Included: org.codehaus.plexus:plexus-interpolation:jar:1.26
[DEBUG] Included: commons-validator:commons-validator:jar:1.7
[DEBUG] Included: commons-beanutils:commons-beanutils:jar:1.9.4
[DEBUG] Included: commons-digester:commons-digester:jar:2.1
[DEBUG] Included: commons-logging:commons-logging:jar:1.2
[DEBUG] Included: commons-io:commons-io:jar:2.11.0
[DEBUG] class org.apache.maven.report.projectinfo.DependenciesReport isMavenReport: true
[DEBUG] Loading mojo org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.4-SNAPSHOT:dependencies from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.4-SNAPSHOT, parent: ClassRealm[plugin>org.apache.maven.plugins:maven-site-plugin:3.3, parent: sun.misc.Launcher$AppClassLoader@7852e922]]
[WARNING] Error injecting: org.apache.maven.report.projectinfo.DependenciesReport
java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent
at java.lang.Class.getDeclaredConstructors0 (Native Method)
at java.lang.Class.privateGetDeclaredConstructors (Class.java:2671)
at java.lang.Class.getDeclaredConstructors (Class.java:2020)
at com.google.inject.spi.InjectionPoint.forConstructorOf (InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create (ConstructorBindingImpl.java:115)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding (InjectorImpl.java:706)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding (InjectorImpl.java:930)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive (InjectorImpl.java:852)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding (InjectorImpl.java:291)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow (InjectorImpl.java:222)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow (InjectorImpl.java:1040)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1071)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1034)
at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1086)
at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:85)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:112)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:127)
at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050)
at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:520)
at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.getConfiguredMavenReport (DefaultMavenReportExecutor.java:306)
at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildReportPlugin (DefaultMavenReportExecutor.java:263)
at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildMavenReports (DefaultMavenReportExecutor.java:154)
at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getReports (AbstractSiteRenderingMojo.java:235)
at org.apache.maven.plugins.site.SiteMojo.execute (SiteMojo.java:121)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
at java.lang.Class.getDeclaredConstructors0 (Native Method)
at java.lang.Class.privateGetDeclaredConstructors (Class.java:2671)
at java.lang.Class.getDeclaredConstructors (Class.java:2020)
at com.google.inject.spi.InjectionPoint.forConstructorOf (InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create (ConstructorBindingImpl.java:115)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding (InjectorImpl.java:706)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding (InjectorImpl.java:930)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive (InjectorImpl.java:852)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding (InjectorImpl.java:291)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow (InjectorImpl.java:222)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow (InjectorImpl.java:1040)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1071)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1034)
at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1086)
at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:85)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:112)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:127)
at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050)
at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:520)
at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.getConfiguredMavenReport (DefaultMavenReportExecutor.java:306)
at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildReportPlugin (DefaultMavenReportExecutor.java:263)
at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildMavenReports (DefaultMavenReportExecutor.java:154)
at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getReports (AbstractSiteRenderingMojo.java:235)
at org.apache.maven.plugins.site.SiteMojo.execute (SiteMojo.java:121)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.116 s
[INFO] Finished at: 2023-05-21T11:57:27+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project MPIR-431: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: A required class was missing while executing org.apache.maven.plugins:maven-site-plugin:3.3:site: org/apache/maven/doxia/siterenderer/DocumentContent
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-site-plugin:3.3
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.jar
[ERROR] urls[1] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/apache/maven/reporting/maven-reporting-exec/1.1/maven-reporting-exec-1.1.jar
[ERROR] urls[2] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar
[ERROR] urls[3] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/apache/maven/shared/maven-shared-utils/0.3/maven-shared-utils-0.3.jar
[ERROR] urls[4] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[5] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[6] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[7] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[8] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[9] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[10] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[11] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[12] = file:/D:/Entwicklung/Projekte/maven-project-info-reports-plugin/target/local-repo/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
a4725ae
to
09dfef3
Compare
"", | ||
"", | ||
"" | ||
artifactFile.getName(), fileLengthDecimalFormat.format(artifactFile.length()), "", "", "", "", "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is one column gone here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix it
...ain/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not 100% happy with the usage of integer literals for the scopes now because this is fragile and can change, bugs can creep in. Would you turn them into static finals or something better?
...ain/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
Outdated
Show resolved
Hide resolved
…lumn into execution and test versions This closes apache#47
Just FYI: With this change I'm getting:
|
@pzygielo Thanks for the heads up. Can you please file a JIRA and maybe a test case? I wonder what we have missed. |
This seems to be the problem:
|
Ran with the old version. Something is wrong because the classifer is shown as scope. Non-sense. |
Trying 3.4.5-SNAPSHOT which uses maven-dependency-tree 3.2.1 which does not have this problem, but gives me:
|
OK, there is no bug, but this POM is just broken: https://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-remote-driver/4.9.1/selenium-remote-driver-4.9.1.pom |
Idiotlike approach:
The debug column value does not make sense if no Java version could be determined. |
@belingueres This is my proposal: a38c46b No fuzz, straight forward. |
Thanks to all checking this case. If a38c46b prevents breaking the build/NPEx - I like it 😁 |
column into execution and test versions
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[MPIR-XXX] - Fixes bug in ApproximateQuantiles
,where you replace
MPIR-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean verify
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean verify
).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.