Discussion:
Is compile classpath deterministic?
Dagang Wei
2018-10-20 22:23:36 UTC
Permalink
Hi folks,

I ran into an issue of compile dependency conflict caused by same class
name (javax.ws.rs.core.Response) with different method signatures in
different artifacts (jsr311-api and javax.ws.rs-api). On one machine, it
compiles because it compiles against javax.ws.rs-api; on another machine,
it doesn't, because it compiles against jsr311-api.

So, I am wondering if the compile classpath deterministic? If not, can we
make it deterministic so that it is easier to discover and debug dependency
issues?

Thanks!
Dagang
Elliotte Rusty Harold
2018-10-21 22:43:59 UTC
Permalink
In general, yes, the compile time classpath is deterministic. However
there are a few ways it can get mucked up including extra jars in your
VMs jre/lib/ext folder. Their may be other ways those jars can mess
with you, especially if they have scope provided.

Also, you probably shouldn't have two artifacts that define the same
classes. That's what I'd look at fixing first.
Post by Dagang Wei
Hi folks,
I ran into an issue of compile dependency conflict caused by same class
name (javax.ws.rs.core.Response) with different method signatures in
different artifacts (jsr311-api and javax.ws.rs-api). On one machine, it
compiles because it compiles against javax.ws.rs-api; on another machine,
it doesn't, because it compiles against jsr311-api.
So, I am wondering if the compile classpath deterministic? If not, can we
make it deterministic so that it is easier to discover and debug dependency
issues?
Thanks!
Dagang
--
Elliotte Rusty Harold
***@ibiblio.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@maven.apache.org
For additional commands, e-mail: dev-***@maven.apache.org
Martin Gainty
2018-10-22 15:11:37 UTC
Permalink
i am curious as to your ${packaging.type} from both pom.xml resolve to?

https://javaee.groups.io/g/jersey/topic/jersey_2_26_and_jax_rs_2_1/6052416?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,6052416

?
________________________________
From: Dagang Wei <***@gmail.com>
Sent: Saturday, October 20, 2018 6:23 PM
To: ***@maven.apache.org
Subject: Is compile classpath deterministic?

Hi folks,

I ran into an issue of compile dependency conflict caused by same class
name (javax.ws.rs.core.Response) with different method signatures in
different artifacts (jsr311-api and javax.ws.rs-api). On one machine, it
compiles because it compiles against javax.ws.rs-api; on another machine,
it doesn't, because it compiles against jsr311-api.

So, I am wondering if the compile classpath deterministic? If not, can we
make it deterministic so that it is easier to discover and debug dependency
issues?

Thanks!
Dagang

Loading...