Comments (8)
Hi rouzwawi,
I have tried to reconstruct your issue. The pom.xml of my base project looks like this one:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>japicmp-test</groupId>
<artifactId>japicmp-test-base</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>japicmp-test-commons</module>
</modules>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
</dependencies>
</project>
The child module japicmp-test-commons
has the following pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>japicmp-test-base</artifactId>
<groupId>japicmp-test</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>japicmp-test-commons</artifactId>
<build>
<plugins>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<version>0.5.1</version>
<configuration>
<oldVersion>
<file>
<path>${project.build.directory}/${project.artifactId}-${project.version}.jar</path>
</file>
</oldVersion>
<newVersion>
<file>
<path>${project.build.directory}/${project.artifactId}-${project.version}.jar</path>
</file>
</newVersion>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>cmp</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Now the japicmp
plugin outputs:
[INFO] --- japicmp-maven-plugin:0.5.1:cmp (default) @ japicmp-test-commons ---
[INFO] /opt/maven/repository/guava-18.0.jar; scope: compile
...
Note that the second [INFO]
line denotes that the guava library from the parent pom has been added to the classpath. Hence I was not able to reproduce the issue.
Can you check with mvn help:effective-pom
within the child module's directory that the guava dependency you are missing is shown in the dependencies
section?
from japicmp.
I've tried to isolate the problem a bit more now and I have an example that triggers it here: https://github.com/rouzwawi/japicmp-test
The setup is two modules a
and b
where a
depends on guava
and exposes a type SpecialFuture extends AbstractFuture
. b
in turn depends on a
and exposes SpecialFuture
in it's public api.
I get:
[ERROR] Failed to execute goal com.github.siom79.japicmp:japicmp-maven-plugin:0.5.1:cmp (default) on project test-leaf: Execution default of goal com.github.siom79.japicmp:japicmp-maven-plugin:0.5.1:cmp failed: Could not load 'com.example.Using$MyFuture': com.google.common.util.concurrent.AbstractFuture. Please make sure that all libraries have been added to the classpath (CLASSPATH=/usr/local/Cellar/maven/3.3.3/libexec/boot/plexus-classworlds-2.5.2.jar:/Users/rouz/code/japicmp-transitive/a/target/test-common-1.0.0-SNAPSHOT.jar) or try the option '--ignore-missing-classes'. -> [Help 1]
While trying to provoke the error I noticed that it only happens when my jar somehow exposes a type from the transitive dependency. In this case, MyFuture
extends SpecialFuture
which extends AbstractFuture
from guava.
The same thing happens if I have this in my public api
// exposed somehwere in test-leaf
public SpecialFuture foo() {
return new SpecialFuture() {};
}
from japicmp.
Thank you for setting up such a detailed project that triggers the problem. With its help I could track down the issue in the japicmp maven plugin. The solution is rather simple (see here).
I have committed the fix on the develop
branch. With your project setup this worked.
If you want you can try it yourself:
git clone https://github.com/siom79/japicmp.git
cd japicmp
git checkout develop
mvn clean install
Then update the version of the japicmp maven plugin in your sample project to 0.5.2-SNAPSHOT
and rebuild it.
from japicmp.
Neat fix! And i just tried the develop branch on my real project and it all works fine!
Thanks!
from japicmp.
I recently tried the japicmp maven plugin in my project and this fix is a must have for me. It's working perfectly with the develop branch version.
from japicmp.
@siom79 do you have an ETA on 0.5.2?
from japicmp.
As soon as I have feedback for issue #66, I will release these two issues.
from japicmp.
Released with version 0.5.2.
from japicmp.
Related Issues (20)
- Filter for full annotations HOT 5
- >=0.16.0: Cannot compare versions because the number of old versions is different than the number of new versions HOT 4
- Move of method to superclass with generics METHOD_REMOVED HOT 1
- New default method detected as METHOD_NEW_DEFAULT when BinaryIncompatible disabled and SourceIncompatible enabled HOT 1
- htmlTitle not actually added to html file HOT 2
- Changing default method to static should be separate case HOT 5
- Switch to Apache Groovy HOT 1
- False positive when making a package-private class public that already has a public static method's different return type HOT 5
- Maven plugin does not obey property japicmp.skip when generating reports. HOT 2
- False positive when on a final class protected method made into private HOT 1
- Regression CLASS_GENERIC_TEMPLATE_CHANGED HOT 2
- Questions about the mechanism of binary compatibility checks HOT 2
- some newer kotlin changes show up as a binary string HOT 3
- Take `transient` modifier into account
- have some sort of "warn" level HOT 1
- Do not mark class as changed in case of synthetic member
- JApiCmpArchive should support byte arrays
- Take `volatile` modifier into account
- `METHOD_RETURN_TYPE_CHANGED` reported for `package-private` method promoted to `public` that changes return type HOT 15
- Take changes to annotations into account HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from japicmp.