-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import jolokia-jvm as jolokia/jolokia.jar and add agent
- Loading branch information
Showing
13 changed files
with
100 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
language: scala | ||
script: sbt test | ||
script: | ||
- sbt ++$TRAVIS_SCALA_VERSION scripted | ||
scala: | ||
- 2.10.6 | ||
jdk: | ||
- oraclejdk8 | ||
cache: | ||
directories: | ||
- $HOME/.sbt/0.13 | ||
- $HOME/.sbt/boot/scala* | ||
- $HOME/.sbt/cache | ||
- $HOME/.sbt/launchers | ||
- $HOME/.ivy2 | ||
before_cache: | ||
- du -h -d 1 $HOME/.ivy2/ | ||
- du -h -d 2 $HOME/.sbt/ | ||
- find $HOME/.sbt -name "*.lock" -type f -delete | ||
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
sbtPlugin := true | ||
|
||
organization := "com.jatescher" | ||
|
||
name := """sbt-jolokia""" | ||
|
||
version := "0.0.1" | ||
version := "0.0.1-SNAPSHOT" | ||
|
||
scalaVersion := "2.10.6" | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.6") | ||
|
||
scalaVersion := "2.11.7" | ||
licenses += ("MIT", url("http://opensource.org/licenses/MIT")) | ||
|
||
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.5" % "test" | ||
// Test scripts | ||
ScriptedPlugin.scriptedSettings | ||
scriptedLaunchOpts := { scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-Dplugin.version=" + version.value) } | ||
scriptedBufferLog := false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#Activator-generated Properties | ||
#Thu Jan 21 09:34:26 PST 2016 | ||
template.uuid=e17acfbb-1ff5-41f5-b8cf-2c40be6a8340 | ||
sbt.version=0.13.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.jatescher | ||
|
||
import com.typesafe.sbt.SbtNativePackager._ | ||
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging | ||
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging.autoImport.bashScriptExtraDefines | ||
import sbt._ | ||
import sbt.Keys._ | ||
|
||
object Jolokia extends AutoPlugin { | ||
|
||
object autoImport { | ||
val jolokiaAgent = taskKey[File]("Jolokia agent jar location") | ||
val jolokiaVersion = settingKey[String]("Jolokia version") | ||
val jolokiaPort = settingKey[String]("Jolokia port") | ||
val jolokiaHost = settingKey[String]("Jolokia host") | ||
} | ||
|
||
import autoImport._ | ||
|
||
override def requires = JavaAppPackaging | ||
|
||
val jolokiaConfig = config("jolokia-jvm").hide | ||
|
||
override lazy val projectSettings = Seq( | ||
ivyConfigurations += jolokiaConfig, | ||
jolokiaAgent := findJolokiaAgent(update.value), | ||
jolokiaVersion := "1.3.2", | ||
jolokiaPort := "8778", | ||
jolokiaHost := "0.0.0.0", | ||
libraryDependencies += "org.jolokia" % "jolokia-jvm" % jolokiaVersion.value % jolokiaConfig, | ||
mappings in Universal ++= Seq( | ||
jolokiaAgent.value -> "jolokia/jolokia.jar" | ||
), | ||
bashScriptExtraDefines += """addJava "-javaagent:${app_home}/../jolokia/jolokia.jar=port=${jolokiaPort},host=${jolokiaHost}"""" | ||
) | ||
|
||
private[this] val jolokiaFilter: DependencyFilter = configurationFilter("jolokia-jvm") && artifactFilter(`type` = "jar") | ||
|
||
def findJolokiaAgent(report: UpdateReport) = report.matching(jolokiaFilter).head | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
object Main extends App { | ||
println("Sentinel") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
enablePlugins(JavaAppPackaging, Jolokia) | ||
|
||
name := "app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=0.13.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.6") | ||
|
||
{ | ||
val pluginVersion = System.getProperty("plugin.version") | ||
if(pluginVersion == null) | ||
throw new RuntimeException("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
else addSbtPlugin("com.jatescher" % "sbt-jolokia" % pluginVersion) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
> universal:stage | ||
$ exists target/universal/stage/jolokia/jolokia.jar | ||
$ exec grep -q "addJava .*jolokia.jar" target/universal/stage/bin/app |
This file was deleted.
Oops, something went wrong.