Skip to content
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

Pin bijection-guava to jsr305 1.3.9. #164

Merged
merged 1 commit into from
Feb 25, 2014
Merged

Pin bijection-guava to jsr305 1.3.9. #164

merged 1 commit into from
Feb 25, 2014

Conversation

jsirois
Copy link

@jsirois jsirois commented Feb 25, 2014

The bijection-guava module works around guava only requiring jsr305 in
provided scope yet scalac needing all java annotations at compile time
by adding an explicit dep on jsr305. It was using a valid ivy
revision string with a trailing +, ie: '1.3.+' - and this works fine
for sbt / ivy; however make-pom does not attempt to map ivy version
numbers to valid pom version numbers and a trailing + is treated as a
literal and not a ranged version by maven / pom consumers [1]. This
work-around just pins jsr305 to 1.3.9 which is what guava 14 asks for
(in provided scope) in its own pom. Another valid approach is to use
'[1.3,)' as the version which is valid in ivy.xml, sbt and pom.xml,
but fwict the original use of '1.3.+' was just copypasta from this bug
report: http://code.google.com/p/guava-libraries/issues/detail?id=1095

[1] https://github.com/sbt/sbt/blob/b7c50d42698f8309c76ed5fd0efbb3ef61ee601e/ivy/src/main/scala/sbt/MakePom.scala

The bijection-guava module works around guava only requiring jsr305 in
provided scope yet scalac needing all java annotations at compile time
by adding an explicit dep on jsr305.  It was using a valid ivy
revision string with a trailing +, ie: '1.3.+' - and this works fine
for sbt / ivy; however make-pom does not attempt to map ivy version
numbers to valid pom version numbers and a trailing + is treated as a
literal and not a ranged version by maven / pom consumers [1]. This
work-around just pins jsr305 to 1.3.9 which is what guava 14 asks for
(in provided scope) in its own pom.  Another valid approach is to use
'[1.3,)' as the version which is valid in ivy.xml, sbt and pom.xml,
but fwict the original use of '1.3.+' was just copypasta from this bug
report: http://code.google.com/p/guava-libraries/issues/detail?id=1095

[1] https://github.com/sbt/sbt/blob/b7c50d42698f8309c76ed5fd0efbb3ef61ee601e/ivy/src/main/scala/sbt/MakePom.scala
@jsirois
Copy link
Author

jsirois commented Feb 25, 2014

Note that I updated the comment in project/Build.scala after running this experiment:

$ mkdir test
$ cd test
$ cat << EOF > Foo.java
> import java.lang.annotation.ElementType;
> import java.lang.annotation.Target;
> import java.lang.annotation.RetentionPolicy;
> import java.lang.annotation.Retention;
> 
> @Target(ElementType.TYPE)
> @Retention(RetentionPolicy.RUNTIME)
> public @interface Foo{}
> EOF
$ cat << EOF > Bar.java
> @Foo
> public class Bar {
>   public static void main(String[] args) {
>     System.out.println("Fooed Bar");
>   }
> }
> EOF
$ javac Foo.java Bar.java 
$ java -cp . Bar
Fooed Bar
$ ls -1
Bar.class
Bar.java
Foo.class
Foo.java
$ rm Foo.class 
$ ls -1
Bar.class
Bar.java
Foo.java
$ java -cp . Bar
Fooed Bar

@jsirois
Copy link
Author

jsirois commented Feb 25, 2014

Note, filed a bug with sbt for the underlying issue here: sbt/sbt#1136

ianoc added a commit that referenced this pull request Feb 25, 2014
…round

Pin bijection-guava to jsr305 1.3.9.
@ianoc ianoc merged commit 3dddb45 into twitter:develop Feb 25, 2014
@ianoc
Copy link
Collaborator

ianoc commented Feb 25, 2014

Merged, thanks!

@jsirois jsirois deleted the bijection-guava/jsr305_pom_workaround branch February 25, 2014 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants