I am using gatling tool for performance testing.My gatling code is running perfectly. i am using intellij IDEA for my project. I am trying to create a jar file. It cannot created. i think this is sbt problem.please someone correct my sb My build.sbt file is here:
import io.gatling.sbt.GatlingPlugin
import sbtassembly.MergeStrategy
parallelExecution in Test := false
enablePlugins(GatlingPlugin, AssemblyPlugin)
lazy val root = (project in file("."))
.configs(IntegrationTest)
.settings(Defaults.itSettings: _*)
Project.inConfig(IntegrationTest)(baseAssemblySettings)
mainClass in assembly := Some("gatling.GatlingMain")
assemblyMergeStrategy in assembly := {
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
libraryDependencies ++= Seq(
"com.typesafe.play" % "play-json_2.11" % "2.6.2" % IntegrationTest,
"org.scalacheck" % "scalacheck_2.11" % "1.13.5" % IntegrationTest,
"com.typesafe" % "config" % "1.3.1" % IntegrationTest,
"io.gatling.highcharts" % "gatling-charts-highcharts" % "2.2.5" %
IntegrationTest,
"io.gatling" % "gatling-test-framework" % "2.2.5" % IntegrationTest,
"com.google.code.gson" % "gson" % "2.8.0" % IntegrationTest
)
resourceDirectory in Compile := baseDirectory.value /"resources"
assemblyJarName in (IntegrationTest, assembly):=s"${name.value}-${version.value}.jar"
when i am trying to create a jar file using sbt command sbt "it:assembly"
It shows the following error
[error] 1 error was encountered during merge
java.lang.RuntimeException: deduplicate: different file contents found in the following:
/Users/james/.ivy2/cache/io.netty/netty-buffer/jars/netty-buffer-4.0.44.Final.jar:META-INF/io.netty.versions.properties
/Users/james/.ivy2/cache/io.netty/netty-common/jars/netty-common-4.0.44.Final.jar:META-INF/io.netty.versions.properties
/Users/james/.ivy2/cache/io.netty/netty-codec-http/jars/netty-codec-http-4.0.44.Final.jar:META-INF/io.netty.versions.properties
/Users/james/.ivy2/cache/io.netty/netty-codec/jars/netty-codec-4.0.44.Final.jar:META-INF/io.netty.versions.properties
/Users/james/.ivy2/cache/io.netty/netty-transport/jars/netty-transport-4.0.44.Final.jar:META-INF/io.netty.versions.properties
/Users/james/.ivy2/cache/io.netty/netty-handler/jars/netty-handler-4.0.44.Final.jar:META-INF/io.netty.versions.properties
/Users/james/.ivy2/cache/io.netty/netty-transport-native-epoll/jars/netty-transport-native-epoll-4.0.44.Final-linux-x86_64.jar:META-INF/io.netty.versions.properties
at sbtassembly.Assembly$.applyStrategies(Assembly.scala:140)
at sbtassembly.Assembly$.x$1$lzycompute$1(Assembly.scala:25)
at sbtassembly.Assembly$.x$1$1(Assembly.scala:23)
at sbtassembly.Assembly$.stratMapping$lzycompute$1(Assembly.scala:23)
at sbtassembly.Assembly$.stratMapping$1(Assembly.scala:23)
at sbtassembly.Assembly$.inputs$lzycompute$1(Assembly.scala:67)
at sbtassembly.Assembly$.inputs$1(Assembly.scala:57)
at sbtassembly.Assembly$.apply(Assembly.scala:83)
at sbtassembly.Assembly$$anonfun$assemblyTask$1.apply(Assembly.scala:245)
at sbtassembly.Assembly$$anonfun$assemblyTask$1.apply(Assembly.scala:242)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (it:assembly) deduplicate: different file contents found in the following:
[error] /Users/james/.ivy2/cache/io.netty/netty-buffer/jars/netty-buffer-4.0.44.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/james/.ivy2/cache/io.netty/netty-common/jars/netty-common-4.0.44.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/james/.ivy2/cache/io.netty/netty-codec-http/jars/netty-codec-http-4.0.44.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/james/.ivy2/cache/io.netty/netty-codec/jars/netty-codec-4.0.44.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/james/.ivy2/cache/io.netty/netty-transport/jars/netty-transport-4.0.44.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/james/.ivy2/cache/io.netty/netty-handler/jars/netty-handler-4.0.44.Final.jar:META-INF/io.netty.versions.properties
My sbt version is 0.13.16 and my scala version is 2.11.8. please someone help me to resolve this error. Thanks in advance
Most likely you don't need io.netty.versions.properties from all the io.netty libraries, one may be enough. I think something like this should work:
assemblyMergeStrategy in assembly := {
case p if p.endsWith("io.netty.versions.properties") =>
MergeStrategy.first
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
Related
I am struggling to resolve the issue but hard to pinpoint the issue regarding the Sbt.
When I assembly using sbt then it throw the error as below.
The entire of the contents is large so I just attached the part of that.
[error] (assembly) deduplicate: different file contents found in the following:
[error] /Users/sclee01/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/netty/netty-all/4.1.68.Final/netty-all-4.1.68.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/sclee01/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/netty/netty-buffer/4.1.50.Final/netty-buffer-4.1.50.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/sclee01/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/netty/netty-codec/4.1.50.Final/netty-codec-4.1.50.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/sclee01/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/netty/netty-common/4.1.50.Final/netty-common-4.1.50.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/sclee01/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/netty/netty-handler/4.1.50.Final/netty-handler-4.1.50.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/sclee01/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/netty/netty-resolver/4.1.50.Final/netty-resolver-4.1.50.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/sclee01/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.50.Final/netty-transport-native-epoll-4.1.50.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/sclee01/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.50.Final/netty-transport-native-unix-common-4.1.50.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/sclee01/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/netty/netty-transport/4.1.50.Final/netty-transport-4.1.50.Final.jar:META-INF/io.netty.versions.properties
I googled it and changed my assembly mergy strategy as below, but it didn't work.
As you can see, I added the case PathList("META-INF", _*) => MergeStrategy.discard to my code but the META-INF/* related errors were not disappear.
Any help will be appreciated.
Thanks.
assembly / assemblyMergeStrategy := {
case PathList("META-INF", _*) => MergeStrategy.discard
case "module-info.class" => MergeStrategy.discard
case "logback.xml" => MergeStrategy.discard
case PathList("mime.types") => MergeStrategy.last
case PathList("META-INF", xs # _*) => {
xs match {
case "services" :: _ :: Nil => MergeStrategy.concat
case _ => MergeStrategy.discard
}
}
I have written the following rule in sbt to delete a directory but the code doesn't delete the directory. What I am doing wrong?
def clearOldUiBuild(implicit dir:File):Boolean = {
println(s"Deleting ui directory. Implicit directory ${dir}")
val uiBuildDirectory = dir / "public/ui"
println(s"ui build path ${uiBuildDirectory}")
val directoryExists = uiBuildDirectory.exists() && uiBuildDirectory.isDirectory()
println(s"ui exists? ${directoryExists}")
if(directoryExists){
println(s"deleting directory ${uiBuildDirectory}")
val retExecutable = uiBuildDirectory.setExecutable(true)
val retRead = uiBuildDirectory.setReadable(true)
val retWrite = uiBuildDirectory.setWritable(true)
println(s"set executable result ${retExecutable}, ${retRead}, ${retWrite}")
val ret = uiBuildDirectory.delete()
println(s"delete result ${ret}")
ret
} else {
println(s"directory doesn't exist")
true
}
}
output
[IJ][projectname] $ clear-old-ui-build
Deleting ui directory. Implicit directory C:\...frontend\web
ui build path C:\...\frontend\web\public\ui
ui exists? true
deleting directory C:\..\ui
set executable result true, true, false
delete result false
[trace] Stack trace suppressed: run 'last *:clearOldUiBuild' for the full output.
[error] (*:clearOldUiBuild) java.lang.Exception: Oops! UI Build crashed.
[error] Total time: 0 s, completed 08-Jan-2021 18:26:44
[IJ][myproject] $ last *:clearOldUiBuild
java.lang.Exception: Oops! UI Build crashed.
at $6ac9788b23c613fff84d$$anonfun$$sbtdef$1.apply(C:\...\frontend\web\build.sbt:341)
at $6ac9788b23c613fff84d$$anonfun$$sbtdef$1.apply(C:\...\build.sbt:339)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[error] (*:clearOldUiBuild) java.lang.Exception: Oops! UI Build crashed.
Using sbt 13.8, the newest scala plugin for IntelliJ, and a new SBT project with Scala 2.11.7, I try to add a single library - akka 2.4.2. following this, i simply add
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.4.2"
But I am getting an unresolved dependency error:
Error:Error while importing SBT project:
[info] Resolving org.scala-sbt#tasks;0.13.8 ...
[info] Resolving org.scala-sbt#tracking;0.13.8 ...
[info] Resolving org.scala-sbt#cache;0.13.8 ...
[info] Resolving org.scala-sbt#testing;0.13.8 ...
[info] Resolving org.scala-sbt#test-agent;0.13.8 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving org.scala-sbt#main-settings;0.13.8 ...
[info] Resolving org.scala-sbt#apply-macro;0.13.8 ...
[info] Resolving org.scala-sbt#command;0.13.8 ...
[info] Resolving org.scala-sbt#logic;0.13.8 ...
[info] Resolving org.scala-sbt#precompiled-2_8_2;0.13.8 ...
[info] Resolving org.scala-sbt#precompiled-2_9_2;0.13.8 ...
[info] Resolving org.scala-sbt#precompiled-2_9_3;0.13.8 ...
[trace] Stack trace suppressed: run 'last common/*:update' for the full output.
[trace] Stack trace suppressed: run 'last common/*:ssExtractDependencies' for the full output.
[trace] Stack trace suppressed: run 'last
app1/*:ssExtractDependencies' for the full output.
[error] (common/*:update) sbt.ResolveException: unresolved dependency: com.typesafe.akka#akka actor_2.10;2.4.2: not found
[error] (common/*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: com.typesafe.akka#akka-actor_2.10;2.4.2: not found
[error] (app1/*:ssExtractDependencies) sbt.ResolveException:
unresolved dependency: com.typesafe.akka#akka-actor_2.10;2.4.2: not found
why is sbt trying to find akka-actor_2.10 if I set project to 2.11.7?
UPDATE:
explicitly stating version,
libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.4.2"
works but then you get an SBT project import warning:
[warn] Scala version was updated by one of library dependencies:
[warn] Binary version (2.11) for dependency org.scala-lang#scala-library;2.11.7 [warn] in com.myorg#common$sources_2.10;1.0 differs from Scala binary version in project (2.10).
[warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:
[warn] * org.scala-lang:scala-library:(2.11.7, 2.10.4)...
EDIT:
build.sbt
import Dependencies._
name := "coolApps"
version := "1.0"
scalaVersion := "2.11.7"
lazy val common = (project in file("common")).
settings(Commons.settings: _*).
settings(
libraryDependencies ++= commonDependencies
// dependencyOverrides += "org.scala-lang" % "scala-library" % scalaVersion.value
)
lazy val app1 = (project in file("app1")).
settings(Commons.settings: _*).
settings(
libraryDependencies ++= app1Dependencies
).
dependsOn(common)
Dependencies.scala
object Dependencies {
val akka = "com.typesafe.akka" %% "akka-actor" % "2.4.2"
val commonDependencies: Seq[ModuleID] = Seq(
akka
)
val app1Dependencies: Seq[ModuleID] = Seq()
}
Commons.scala
import sbt._
import Keys._
object Commons {
val coolAppVersion = "1.0"
val settings: Seq[Def.Setting[_]] = Seq(
organization := "com.company",
version := coolAppVersion,
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8"),
resolvers ++= Seq(
"Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/"
)
)
}
In your build.sbt, you need to set the key
scalaVersion := "2.11.7"
If you don't set this, it'll use the scala used by SBT itself which is a 2.10.x version.
Problem
I use YAML scripts that describes my DB objects structure. It is very convenient because I can have DB-based integration tests with H2.
But the Production service of my client requires that we provide Oracle oriented SQL scripts (they use Liquibase, but in a not standard way, that we cannot challenge/change).
So I would like to generate these Oracle SQL scripts from my YAML ones, in an automatically way.
Thoughts
I firstly found the Liquibase:updateSQL command. Problem is that I do not have access to the DB (I don't know the JDBC URL, neither am I on the same network). So this solution can not work.
Then, I found a new option in Liquibase that allow "offline" mode for updateSQL command. It really seems to be the solution I'm looking for but then I have the following error (using Maven and -X -e options) :
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL (default-cli) on project granit: Error setting up or running Liquibase: liquibase.exception.UnexpectedLiquibaseException: java.lang.NoSuchMethodException: liquibase.database.OfflineConnection.getWrappedConnection() -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL (default-cli) on project granit: Error setting up or running Liquibase: liquibase.exception.UnexpectedLiquibaseException: java.lang.NoSuchMethodException: liquibase.database.OfflineConnection.getWrappedConnection()
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error setting up or running Liquibase: liquibase.exception.UnexpectedLiquibaseException: java.lang.NoSuchMethodException: liquibase.database.OfflineConnection.getWrappedConnection()
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:373)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: liquibase.exception.DatabaseException: liquibase.exception.UnexpectedLiquibaseException: java.lang.NoSuchMethodException: liquibase.database.OfflineConnection.getWrappedConnection()
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:69)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:321)
... 21 more
Caused by: liquibase.exception.UnexpectedLiquibaseException: java.lang.NoSuchMethodException: liquibase.database.OfflineConnection.getWrappedConnection()
at liquibase.database.core.OracleDatabase.setConnection(OracleDatabase.java:62)
at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:123)
at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:143)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:50)
... 22 more
Caused by: java.lang.NoSuchMethodException: liquibase.database.OfflineConnection.getWrappedConnection()
at java.lang.Class.getMethod(Class.java:1624)
at liquibase.database.core.OracleDatabase.setConnection(OracleDatabase.java:58)
... 25 more
I then re-try with offline H2 base but I've got a new error :
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.748 s
[INFO] Finished at: 2015-02-22T12:00:51+01:00
[INFO] Final Memory: 19M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL (default-cli) on project app: Execution default-cli of goal org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL failed: A required class was missing while executing org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL: org/yaml/snakeyaml/Yaml
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.liquibase:liquibase-maven-plugin:3.3.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/me/.m2/repository/org/liquibase/liquibase-maven-plugin/3.3.2/liquibase-maven-plugin-3.3.2.jar
[ERROR] urls[1] = file:/Users/me/.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
[ERROR] urls[2] = file:/Users/me/.m2/repository/org/liquibase/liquibase-core/3.3.2/liquibase-core-3.3.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>fr.cnp.grn:app:1.0.14-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------: org.yaml.snakeyaml.Yaml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL (default-cli) on project app: Execution default-cli of goal org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL failed: A required class was missing while executing org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL: org/yaml/snakeyaml/Yaml
-----------------------------------------------------
realm = plugin>org.liquibase:liquibase-maven-plugin:3.3.2
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/me/.m2/repository/org/liquibase/liquibase-maven-plugin/3.3.2/liquibase-maven-plugin-3.3.2.jar
urls[1] = file:/Users/me/.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
urls[2] = file:/Users/me/.m2/repository/org/liquibase/liquibase-core/3.3.2/liquibase-core-3.3.2.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[project>fr.cnp.grn:app:1.0.14-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
-----------------------------------------------------
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL failed: A required class was missing while executing org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL: org/yaml/snakeyaml/Yaml
-----------------------------------------------------
realm = plugin>org.liquibase:liquibase-maven-plugin:3.3.2
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/me/.m2/repository/org/liquibase/liquibase-maven-plugin/3.3.2/liquibase-maven-plugin-3.3.2.jar
urls[1] = file:/Users/me/.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
urls[2] = file:/Users/me/.m2/repository/org/liquibase/liquibase-core/3.3.2/liquibase-core-3.3.2.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[project>fr.cnp.grn:app:1.0.14-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
-----------------------------------------------------
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:167)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.liquibase:liquibase-maven-plugin:3.3.2:updateSQL: org/yaml/snakeyaml/Yaml
-----------------------------------------------------
realm = plugin>org.liquibase:liquibase-maven-plugin:3.3.2
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/me/.m2/repository/org/liquibase/liquibase-maven-plugin/3.3.2/liquibase-maven-plugin-3.3.2.jar
urls[1] = file:/Users/me/.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
urls[2] = file:/Users/me/.m2/repository/org/liquibase/liquibase-core/3.3.2/liquibase-core-3.3.2.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[project>fr.cnp.grn:app:1.0.14-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
-----------------------------------------------------
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:165)
... 20 more
Caused by: java.lang.NoClassDefFoundError: org/yaml/snakeyaml/Yaml
at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:44)
at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:356)
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:248)
at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:211)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:215)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.Liquibase.update(Liquibase.java:258)
at org.liquibase.maven.plugins.LiquibaseUpdateSQL.doUpdate(LiquibaseUpdateSQL.java:49)
at org.liquibase.maven.plugins.AbstractLiquibaseUpdateMojo.performLiquibaseTask(AbstractLiquibaseUpdateMojo.java:24)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:369)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
... 20 more
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.Yaml
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
... 32 more
So my questions are :
Does the Liquibase:updateSQL seems to you the right solution ?
Do you succeed to execute Liquibase:updateSQL command in offline mode for Oracle ? (and how ?)
Thank you for reading so far
Having the following build definition file and sbt 0.13.1:
name := "foobar"
val foo = taskKey[Unit]("foo")
val bar = taskKey[Unit]("bar")
foo := { println("foo") }
bar := { println("bar"); throw new Exception("bar exception") }
bar <<= bar triggeredBy foo
When I execute the foo task the exception thrown by the triggered bar task isn't reported:
$ sbt foo
Loading /opt/local/sbt/bin/sbt-launch-lib.bash
[info] Loading global plugins from /home/s.savulchik/.sbt/0.13/plugins
[info] Loading project definition from /home/s.savulchik/projects/foobar/project
[info] Set current project to foobar (in build file:/home/s.savulchik/projects/foobar/)
foo
bar
[success] Total time: 0 s, completed Mar 12, 2014 6:34:52 PM
Instead when I directly execute the bar task the exception in reported as expected:
$ sbt bar
Loading /opt/local/sbt/bin/sbt-launch-lib.bash
[info] Loading global plugins from /home/s.savulchik/.sbt/0.13/plugins
[info] Loading project definition from /home/s.savulchik/projects/foobar/project
[info] Updating {file:/home/s.savulchik/projects/foobar/project/}foobar-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to foobar (in build file:/home/s.savulchik/projects/foobar/)
bar
java.lang.Exception: bar exception
at $df74d6ea1c7cfacc5a14$$anonfun$$sbtdef$1.apply(/home/s.savulchik/projects/foobar/build.sbt:8)
at $df74d6ea1c7cfacc5a14$$anonfun$$sbtdef$1.apply(/home/s.savulchik/projects/foobar/build.sbt:8)
at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:45)
at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:45)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[error] (*:bar) java.lang.Exception: bar exception
[error] Total time: 0 s, completed Mar 12, 2014 6:33:45 PM
Any help is greately appreciated!
Thanks.
As #jsuereth commented, this is either an intentional behavior or a bug. http://github.com/sbt/sbt/issues/1187