Sun jar issues because of dependency on 1.2.15 version of log4j #29

Open
avadh opened this Issue Jun 19, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@avadh

avadh commented Jun 19, 2012

Version 1.2.15 of log4j has dependency on few Sun jars:

  • javax.jms:jms
  • com.sun.jdmk:jmxtools
  • com.sun.jmx:jmxri

These jars are not present anywhere in maven repo and hence cause build issues. Either we can switch back to version 1.2.14 of log4j (which does not depend on these jars) or we should 'exclude' these jars while building the project.
I faced the build issues after forking out the project yesterday. So I modified the corresponding BUILD files to exclude these jars.
Is it already a known issue here?

@jsirois

This comment has been minimized.

Show comment Hide comment
@jsirois

jsirois Jun 25, 2012

Contributor

This is not a known issue - it was thought that all the proper excludes were in place. What command line do you use? (what targets do you build?)

Contributor

jsirois commented Jun 25, 2012

This is not a known issue - it was thought that all the proper excludes were in place. What command line do you use? (what targets do you build?)

@avadh

This comment has been minimized.

Show comment Hide comment
@avadh

avadh Jun 26, 2012

Initially I tried building only thrift target:
./pants src/java/com/twitter/common/thrift
Then I tried building the full build:
./pants tests/java/com/twitter/common:all-tests
Both of them failed because of the above mentioned reasons.

avadh commented Jun 26, 2012

Initially I tried building only thrift target:
./pants src/java/com/twitter/common/thrift
Then I tried building the full build:
./pants tests/java/com/twitter/common:all-tests
Both of them failed because of the above mentioned reasons.

@jsirois

This comment has been minimized.

Show comment Hide comment
@jsirois

jsirois Jun 26, 2012

Contributor

Aha. Yes - this is all undocumented - but we are very close to gutting old pants - which shells out to ant after generating some build.xmls. The new pants is pure python and these targets work:
$ ./pants goal clean-all compile src/java/com/twitter/common/thrift --gen-thrift-lang=java -vx
$ ./pants goal test tests/java/com/twitter/common:all -vx

For now all of new pants is implemented as subcommands to goal, so

To see all goals:
$ ./pants goal

To see help for a goal:
$ ./pants goal help compile

etc...

Note that new pants will spawn nailgun servers for several goals (resolve, compile:javac, cmpile:scalac, checkstyle):
$ ps -ef | grep nailgun
501 59387 1 0 12:00AM ?? 0:02.60 /usr/bin/java -Xmx2g -XX:MaxPermSize=256m -Dtwitter.pants.buildroot=/Users/jsirois/development/third_party/twitter-commons -Dpidfile=.pants.d/ng/ivy/pid -jar /Users/jsirois/development/third_party/twitter-commons/build-support/ng/lib/nailgun-0.7.1.jar :0
501 59402 1 0 12:00AM ?? 0:08.44 /usr/bin/java -Xmx2g -XX:MaxPermSize=256m -Dtwitter.pants.buildroot=/Users/jsirois/development/third_party/twitter-commons -Dpidfile=.pants.d/ng/jmake/pid -jar /Users/jsirois/development/third_party/twitter-commons/build-support/ng/lib/nailgun-0.7.1.jar :0
501 59404 1 0 12:00AM ?? 0:06.39 /usr/bin/java -Xmx2g -XX:MaxPermSize=256m -Dtwitter.pants.buildroot=/Users/jsirois/development/third_party/twitter-commons -Dpidfile=.pants.d/ng/checkstyle/pid -jar /Users/jsirois/development/third_party/twitter-commons/build-support/ng/lib/nailgun-0.7.1.jar :0

Contributor

jsirois commented Jun 26, 2012

Aha. Yes - this is all undocumented - but we are very close to gutting old pants - which shells out to ant after generating some build.xmls. The new pants is pure python and these targets work:
$ ./pants goal clean-all compile src/java/com/twitter/common/thrift --gen-thrift-lang=java -vx
$ ./pants goal test tests/java/com/twitter/common:all -vx

For now all of new pants is implemented as subcommands to goal, so

To see all goals:
$ ./pants goal

To see help for a goal:
$ ./pants goal help compile

etc...

Note that new pants will spawn nailgun servers for several goals (resolve, compile:javac, cmpile:scalac, checkstyle):
$ ps -ef | grep nailgun
501 59387 1 0 12:00AM ?? 0:02.60 /usr/bin/java -Xmx2g -XX:MaxPermSize=256m -Dtwitter.pants.buildroot=/Users/jsirois/development/third_party/twitter-commons -Dpidfile=.pants.d/ng/ivy/pid -jar /Users/jsirois/development/third_party/twitter-commons/build-support/ng/lib/nailgun-0.7.1.jar :0
501 59402 1 0 12:00AM ?? 0:08.44 /usr/bin/java -Xmx2g -XX:MaxPermSize=256m -Dtwitter.pants.buildroot=/Users/jsirois/development/third_party/twitter-commons -Dpidfile=.pants.d/ng/jmake/pid -jar /Users/jsirois/development/third_party/twitter-commons/build-support/ng/lib/nailgun-0.7.1.jar :0
501 59404 1 0 12:00AM ?? 0:06.39 /usr/bin/java -Xmx2g -XX:MaxPermSize=256m -Dtwitter.pants.buildroot=/Users/jsirois/development/third_party/twitter-commons -Dpidfile=.pants.d/ng/checkstyle/pid -jar /Users/jsirois/development/third_party/twitter-commons/build-support/ng/lib/nailgun-0.7.1.jar :0

@avadh

This comment has been minimized.

Show comment Hide comment
@avadh

avadh Jun 28, 2012

As of now, I solved this issue by explicitly excluding these jars from the BUILD file:
"src/thrift/com/twitter/thrift/BUILD"
.
.

java_thrift_library(name = 'thrift',
provides = artifact(
org = 'com.twitter.common',
name = 'service-thrift',
repo = pants('build-support/commons/ivy:public'),
),
excludes = [
exclude(org = 'javax.jms'),
exclude(org = 'com.sun.jdmk'),
exclude(org = 'com.sun.jmx'),
],
sources = globs('*.thrift')
)
.
.
.

avadh commented Jun 28, 2012

As of now, I solved this issue by explicitly excluding these jars from the BUILD file:
"src/thrift/com/twitter/thrift/BUILD"
.
.

java_thrift_library(name = 'thrift',
provides = artifact(
org = 'com.twitter.common',
name = 'service-thrift',
repo = pants('build-support/commons/ivy:public'),
),
excludes = [
exclude(org = 'javax.jms'),
exclude(org = 'com.sun.jdmk'),
exclude(org = 'com.sun.jmx'),
],
sources = globs('*.thrift')
)
.
.
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment