-
Notifications
You must be signed in to change notification settings - Fork 107
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
Make the mojo define old & new classpaths automatically #266
base: master
Are you sure you want to change the base?
Conversation
I did some major refactorings in the Mojo due to the support for Java 16. I had to upgrade to new maven APIs. Hence; I expect that it is difficult to merge this PR. Have you time to try the merge von the current trunk? |
I will try to recheck it merged with trunk. Now is a good time to ask again for advice on
|
No, pelase do not delete these two artifacts. The idea here is that I have two artifacts v1 and v2 and compare them in japicmp-test-service-test with each other. They don't have different versions, because I don't want to have two builds to test. Just one build that creates "two versions" (version in the artifact name). |
Yes, I get that you are comparing different diff --git japicmp-testbase/japicmp-test-service-impl-base/japicmp-test-service-test/pom.xml japicmp-testbase/japicmp-test-service-impl-base/japicmp-test-service-test/pom.xml
index f7a929c..1d084cb 100644
--- japicmp-testbase/japicmp-test-service-impl-base/japicmp-test-service-test/pom.xml
+++ japicmp-testbase/japicmp-test-service-impl-base/japicmp-test-service-test/pom.xml
@@ -94,20 +94,6 @@
<version>${project.version}</version>
</dependency>
</newVersion>
- <oldClassPathDependencies>
- <dependency>
- <groupId>com.github.siom79.japicmp</groupId>
- <artifactId>japicmp-test-service-v1</artifactId>
- <version>${project.version}</version>
- </dependency>
- </oldClassPathDependencies>
- <newClassPathDependencies>
- <dependency>
- <groupId>com.github.siom79.japicmp</groupId>
- <artifactId>japicmp-test-service-v2</artifactId>
- <version>${project.version}</version>
- </dependency>
- </newClassPathDependencies>
<parameter>
<accessModifier>public</accessModifier>
<onlyModified>true</onlyModified> seems to pass without my patch and fail with my patch
which is the opposite of what I was expecting. On
whereas in one-classpath mode two lines are missing:
but I have not tried to resolve merge conflicts yet since it does not look trivial and I would like to sort out the test situation first. |
…hen comparing buffers
I am now able to reproduce the problem in the mojo integration test, by extending it to use more differing signatures in the service module between v1 and v2, and adjusted the mojo to pass the test. There are however lots of operational modes not covered by the test, and some modes not covered by the mojo (see unimplemented clauses in |
Oh before I forget, to iterate quickly (~5s): mvnd install -am -pl japicmp-maven-plugin,japicmp-testbase/japicmp-test-service-impl-base/japicmp-test-service-impl-v2,japicmp-testbase/japicmp-test-service-impl-base/japicmp-test-service-test |
I tried to use japicmp on jenkinsci/jenkins#4848 but the mojo was unusable as is: it automatically added the classpath, but from the new artifact (current effective
pom.xml
) even for the old artifact. Since this PR removed some things from the classpath and added other things, and some of the switched JARs had types used as supertypes of types in the source tree, there were numerous errors blocking report generation.ignoreMissingClasses
allowed the report to proceed, but simply omitted actual incompatibilities I wanted to know about, so this was not a workaround. And given the giant classpath, manually declaring it was not an option either. Note that the documentation claims thatbut this was only true when using
<dependencies>
; when using<oldClassPathDependencies>
and/or<newClassPathDependencies>
, the POM dependencies were calculated but then ignored (since inTWO_SEPARATE_CLASSPATHS
modeclassPathEntries
is silently ignored), so it was not even feasible to manually specify the different classpath elements for the old and new versions. This patch fixes that as well.This patch tries to fix the mojo to behave correctly: the old artifact gets its declared classpath (plus any manual additions), and the new artifact gets its declared classpath (plus any manual additions). There are other modes of looking up the old artifact not covered by this patch. I was also unsure of the best way to add test coverage; should I simply delete the redundant
japicmp/japicmp-testbase/japicmp-test-service-impl-base/japicmp-test-service-test/pom.xml
Lines 97 to 110 in bdf3ce2