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.
Related
My artifactory instance has been running for months but it has completely stopped working since the last update (to 5.11).
When I try to start it up I see the following errors in the logs...
/\
/ \ ___ ___ ___ ___ ___
/ /\ \ / __/ __/ _ \/ __/ __|
/ ____ \ (_| (_| __/\__ \__ \
/_/ \_\___\___\___||___/___/
Access Version: 3.3.2
Access Revision: 30302900
2018-05-15 08:57:43.904 INFO 32571 --- [ost-startStop-1] o.j.a.s.startup.AccessHomeFinderImpl : Using JFrog Access home at '/var/opt/jfrog/artifactory/access' resolved from: System property (Artifactory)
2018-05-15 08:57:44.132 ERROR 32571 --- [ost-startStop-1] o.s.boot.SpringApplication : Application startup failed
java.lang.IllegalArgumentException: Unknown value:
at org.jfrog.access.util.EnumUtils.lambda$fromValue$0(EnumUtils.java:30) ~[access-common-api-3.3.2.jar:na]
at java.util.Optional.orElseThrow(Optional.java:290) ~[na:1.8.0_161]
at org.jfrog.access.util.EnumUtils.fromValue(EnumUtils.java:70) ~[access-common-api-3.3.2.jar:na]
at org.jfrog.access.util.EnumUtils.fromValue(EnumUtils.java:30) ~[access-common-api-3.3.2.jar:na]
at org.jfrog.access.server.home.migration.EnvironmentVersion.fromVersionString(EnvironmentVersion.java:62) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.server.home.migration.EnvironmentConfig.readEnvVersionFile(EnvironmentConfig.java:72) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.server.home.migration.EnvironmentConfig.getConfigVersion(EnvironmentConfig.java:46) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.migration.ConfigMigrationRunner.migrateIfNeeded(ConfigMigrationRunner.java:37) ~[access-common-core-3.3.2.jar:na]
at org.jfrog.access.server.startup.AccessServerStartupFacadeImpl.migrateEnvironment(AccessServerStartupFacadeImpl.java:48) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.server.startup.AccessServerStartupFacadeImpl.prepareEnvironment(AccessServerStartupFacadeImpl.java:30) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.context.AccessApplicationContextInitializer.prepareEnvironment(AccessApplicationContextInitializer.java:48) ~[access-application-3.3.2.jar:3.3.2]
at org.jfrog.access.context.AccessApplicationContextInitializer.prepareEnvironment(AccessApplicationContextInitializer.java:26) ~[access-application-3.3.2.jar:3.3.2]
at org.jfrog.app.context.JFrogApplicationContextInitializer.initialize(JFrogApplicationContextInitializer.java:69) ~[jfrog-application-1.5.2.jar:na]
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:338) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196) [catalina.jar:8.5.23]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.5.23]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) [catalina.jar:8.5.23]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) [catalina.jar:8.5.23]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) [catalina.jar:8.5.23]
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630) [catalina.jar:8.5.23]
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842) [catalina.jar:8.5.23]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_161]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_161]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_161]
May 15, 2018 8:57:44 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/access]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842)
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)
Caused by: java.lang.IllegalArgumentException: Unknown value:
at org.jfrog.access.util.EnumUtils.lambda$fromValue$0(EnumUtils.java:30)
at java.util.Optional.orElseThrow(Optional.java:290)
at org.jfrog.access.util.EnumUtils.fromValue(EnumUtils.java:70)
at org.jfrog.access.util.EnumUtils.fromValue(EnumUtils.java:30)
at org.jfrog.access.server.home.migration.EnvironmentVersion.fromVersionString(EnvironmentVersion.java:62)
at org.jfrog.access.server.home.migration.EnvironmentConfig.readEnvVersionFile(EnvironmentConfig.java:72)
at org.jfrog.access.server.home.migration.EnvironmentConfig.getConfigVersion(EnvironmentConfig.java:46)
at org.jfrog.access.migration.ConfigMigrationRunner.migrateIfNeeded(ConfigMigrationRunner.java:37)
at org.jfrog.access.server.startup.AccessServerStartupFacadeImpl.migrateEnvironment(AccessServerStartupFacadeImpl.java:48)
at org.jfrog.access.server.startup.AccessServerStartupFacadeImpl.prepareEnvironment(AccessServerStartupFacadeImpl.java:30)
at org.jfrog.access.context.AccessApplicationContextInitializer.prepareEnvironment(AccessApplicationContextInitializer.java:48)
at org.jfrog.access.context.AccessApplicationContextInitializer.prepareEnvironment(AccessApplicationContextInitializer.java:26)
at org.jfrog.app.context.JFrogApplicationContextInitializer.initialize(JFrogApplicationContextInitializer.java:69)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:338)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301)
at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151)
at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131)
at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
May 15, 2018 8:57:44 AM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor [/opt/jfrog/artifactory/tomcat/conf/Catalina/localhost/access.xml]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/access]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842)
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)
May 15, 2018 8:57:44 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor [/opt/jfrog/artifactory/tomcat/conf/Catalina/localhost/access.xml] has finished in [6,262] ms
2018-05-15 08:57:44 [ARTIFACTORY] [INFO ] Starting Artifactory [artifactory.home=/var/opt/jfrog/artifactory].
2018-05-15 08:57:44,833 [art-init] [INFO ] (o.a.w.s.ArtifactoryContextConfigListener:265) -
This then causes Artifactory to fail because it cant find the access server
2018-05-15 08:58:03,475 [art-init] [INFO ] (o.a.s.a.ArtifactoryAccessClientConfigStore:556) - Using Access Server URL: http://localhost:8040/access (bundled) source: detected
2018-05-15 08:58:03,959 [art-init] [INFO ] (o.a.s.a.AccessServiceImpl:290) - Waiting for access server...
2018-05-15 08:58:04,678 [art-init] [WARN ] (o.j.a.c.AccessClientHttpException:39) - Unrecognized ErrorsModel by Access. Original message: Failed on executing /api/v1/system/ping, with response: Not Found
2018-05-15 08:58:06,697 [art-init] [WARN ] (o.j.a.c.AccessClientHttpException:39) - Unrecognized ErrorsModel by Access. Original message: Failed on executing /api/v1/system/ping, with response: Not Found
...
2018-05-15 08:59:35,043 [art-init] [ERROR] (o.a.w.s.ArtifactoryContextConfigListener:92) - Application could not be initialized: Waiting for access server to respond timed-out
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:207)
at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener.access$200(ArtifactoryContextConfigListener.java:63)
at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:88)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'org.artifactory.security.access.AccessService'.; nested exception is java.lang.IllegalStateException: Waiting for access server to respond timed-out
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:250)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:133)
... 7 common frames omitted
Caused by: java.lang.IllegalStateException: Waiting for access server to respond timed-out
at org.artifactory.security.access.AccessServiceImpl.waitForAccessServer(AccessServiceImpl.java:305)
at org.artifactory.security.access.AccessServiceImpl.initAccessService(AccessServiceImpl.java:265)
at org.artifactory.security.access.AccessServiceImpl.initIfNeeded(AccessServiceImpl.java:250)
at org.artifactory.security.access.AccessServiceImpl.init(AccessServiceImpl.java:244)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy41.init(Unknown Source)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:248)
... 8 common frames omitted
2018-05-15 09:01:16,534 [http-nio-8081-exec-1] [ERROR] (o.a.w.s.ArtifactoryFilter:213) - Artifactory failed to initialize: Context is null
I have not been able to find anything about the Access error and none of the posts similar to the Artifactory error (like this https://www.jfrog.com/jira/browse/RTFACT-14477) have helped.
Any assistance would be greatly appreciated.
What version of Artifactory have you upgraded from? Is this a Zip installation?
Have you changed/removed any content in the $ARTIFACTORY_HOME/access/ folder? Specifically the $ARTIFACTORY_HOME/access/data/access.env.version.
Can you confirm this file is there the same it was prior to the upgrade?
Looks like it was touched by someone.
Can you change the content of the file to "4" (1byte, with no space or a blank line afterwards), then restart and see if there is any change.
To resolve this issue, please delete the db.lck + dbex.lck files from the $ARTIFACTORY_HOME/data/derby/ folder.
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)
}
I am trying to use pax-exam-container-karaf for testing an OSGi bundle. When running the test, the test "hangs" for a few minutes then "dies" with the following exception:
java.lang.RuntimeException: Cannot get the remote bundle context
at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:255)
at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.waitForState(RemoteBundleContextClientImpl.java:211)
at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.waitForState(KarafTestContainer.java:528)
at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.startKaraf(KarafTestContainer.java:214)
at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:164)
at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.setUp(EagerSingleStagedReactor.java:86)
at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.beforeClass(EagerSingleStagedReactor.java:136)
at org.ops4j.pax.exam.spi.reactors.ReactorManager.beforeClass(ReactorManager.java:447)
at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:97)
at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Caused by: java.rmi.NotBoundException: a86ba245-b66b-498e-8752-05679dc9041b
at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:166)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:410)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:268)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$78(TCPTransport.java:683)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$2/1267686416.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
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)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:379)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at org.ops4j.pax.exam.rbc.client.intern.RemoteBundleContextClientImpl.getRemoteBundleContext(RemoteBundleContextClientImpl.java:242)
... 34 more
I configure Pax-Exam as (with debug == false):
#Configuration
public Option[] config() throws Exception {
final boolean debug = ConfigurationHelper.getBoolean(
"org.hibernate.testing.osgi.paxExam.debug",
Environment.getProperties(),
DEBUG
);
return options(
when( debug ).useOptions( debugConfiguration( "5005", true ) ),
karafDistributionConfiguration()
.frameworkUrl(
maven()
.groupId( "org.apache.karaf" )
.artifactId( "apache-karaf" )
.type( "tar.gz" )
.versionAsInProject()
)
.unpackDirectory( new File( "target/exam" ) )
.useDeployFolder( false ),
configureConsole()
.ignoreLocalConsole()
.ignoreRemoteShell(),
when( debug ).useOptions( keepRuntimeFolder() ),
logLevel( LogLevelOption.LogLevel.INFO ),
// avoiding additional boot features; specifically "enterprise"
editConfigurationFilePut(
"etc/org.apache.karaf.features.cfg",
"featuresBoot",
"standard"
),
features( hibernateKarafFeatureFile(), "hibernate-native", "hibernate-jpa" )
);
}
I have played with various manifestations of the above configuration, but cannot get anything to work.
The output shows lots of problems resolving artifacts, such as:
Caused by: shaded.org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.ops4j.pax.exam:pax-exam-features:xml:4.5.0
(not one I name explicitly ^^), and:
Caused by: shaded.org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.h2database:h2:jar:1.3.170
and:
Caused by: shaded.org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact log4j:log4j:jar:1.2.17
etc.
What is more... I never see these get resolved into the local Maven cache. Does Karaf (as launched by Pax Exam) not locate these maven dependencies remotely? I cannot speak wrt org.ops4j.pax.exam:pax-exam-features:xml:4.5.0, but log4j and h2 jars exist as named in Maven Central.
Any ideas What I might be missing?
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