Prevent SBT from starting interactive mode - sbt

I like to enter commands while the previous command is still running. When the command completes, my shell will immediately execute the next.
This is no longer possible with modern incarnations of SBT. If you enter anything while SBT is running, it will assume you want to execute what you've entered in SBT's interactive mode.
This is very annoying.
$ sbt test
...
[info]
[info] Passed: Total 348, Failed 0, Errors 0, Passed 348
[success] Total time: 17 s, completed 18/01/2018 4:19:49 PM
> git status
[error] Expected ID character
[error] Not a valid command: git (similar: exit, plugin, set)
[error] Expected project ID
[error] Expected configuration
[error] Expected ':' (if selecting a configuration)
[error] Expected key
[error] Not a valid key: git (similar: ivySbt, target)
[error] git status
[error] ^
>
Can I reconfigure SBT so that the process always terminates after the batch has completed and does not switch to interactive mode?

Related

java.lang.ExceptionInInitializerError at org.alfresco.trashcan.TrashcanCleanerTest.<clinit>(TrashcanCleanerTest.java:67)

How can I solve
java.lang.ExceptionInInitializerError
at org.alfresco.trashcan.TrashcanCleanerTest.<clinit>(TrashcanCleanerTest.java:67)
I pulled down https://github.com/Alfresco/alfresco-trashcan-cleaner-module and ran mvn clean install
It failed with this:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.alfresco.trashcan.TrashcanCleanerTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 17.477 sec <<< FAILURE! - in org.alfresco.trashcan.TrashcanCleanerTest
testCleanBatch(org.alfresco.trashcan.TrashcanCleanerTest) Time elapsed: 0.007 sec <<< ERROR!
java.lang.ExceptionInInitializerError
at org.alfresco.trashcan.TrashcanCleanerTest.<clinit>(TrashcanCleanerTest.java:67)
testCleanSimple(org.alfresco.trashcan.TrashcanCleanerTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.alfresco.trashcan.TrashcanCleanerTest
Results :
Tests in error:
TrashcanCleanerTest.testCleanBatch » ExceptionInInitializer
TrashcanCleanerTest.testCleanSimple » NoClassDefFound Could not initialize cla...
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.667 s
[INFO] Finished at: 2018-06-26T13:05:46-04:00
[INFO] Final Memory: 76M/3925M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project alfresco-trashcan-cleaner: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/owiana/Downloads/alfresco-trashcan-cleaner-module-master/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
It's failing to run this line:
private static ApplicationContext applicationContext = ApplicationContextHelper.getApplicationContext();
The question is Why?
My java is
$ java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
Perhaps I'm trying to run this wrong. What step am I missing?
Try to skip tests by executing mvn clean install -DskipTests

Failure to find org.ops4j.pax.cdi:pax-cdi-features:jar:1.0.0.RC1

I was getting following error while running Apache Karaf through Pax-Exam
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.1.5:features-add-to-repository (features-add-to-repository) on project my-project: Error populating repository: Can't resolve artifact org.ops4j.pax.cdi:pax-cdi-features:xml:features:[1.0.0.RC1,2): Failure to find org.ops4j.pax.cdi:pax-cdi-features:xml:features:[1.0.0.RC1,2) in http://x.x.x.x/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.ops4j.pax.cdi -DartifactId=pax-cdi-features -Dversion=[1.0.0.RC1,2) -Dclassifier=features -Dpackaging=xml -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.ops4j.pax.cdi -DartifactId=pax-cdi-features -Dversion=[1.0.0.RC1,2) -Dclassifier=features -Dpackaging=xml -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
so i tried to get it manually with below maven command
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get
-DrepoUrl=https://oss.sonatype.org/content/repositories/ops4j-snapshots#id=ops4j.sonatype.snapshots.deploy#snapshots#noreleases
-Dartifact=org.ops4j.pax.cdi:pax-cdi-features:1.0.0
but its still giving following error and unable to download it
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:get (default-cli) on project standalone-pom: Couldn't download artifact
: Failure to find org.ops4j.pax.cdi:pax-cdi-features:jar:1.0.0 in http://x.x.x.x/nexus/content/groups/public was cached in the local repository, res
olution will not be reattempted until the update interval of nexus has elapsed or updates are forced
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.ops4j.pax.cdi -DartifactId=pax-cdi-features -Dversion=1.0.0 -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.ops4j.pax.cdi -DartifactId=pax-cdi-features -Dversion=1.0.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[ur
l] -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] org.ops4j.pax.cdi:pax-cdi-features:jar:1.0.0
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] nexus (http://x.x.x.x/nexus/content/groups/public, releases=true, snapshots=true),
[ERROR] temp (https://oss.sonatype.org/content/repositories/ops4j-snapshots#id=ops4j.sonatype.snapshots.deploy#snapshots#noreleases, releases=true, snaps
hots=true)
Update1:
I found while downloading manually its asking about maven-downloader-plugin but i couldnt find this plugin
←[1;31mERROR←[m] ←[1;31m Path to dependency: ←[m
←[1;31mERROR←[m] ←[1;31m 1) org.apache.maven.plugins:maven-downloader-plugin:jar:1.0←[m
←[1;31mERROR←[m] ←[1;31m 2) org.ops4j.pax.cdi:pax-cdi-features:jar:1.0.0.RC2←[m
←[1;31mERROR←[m] ←[1;31m←[m
←[1;31mERROR←[m] ←[1;31m----------←[m
←[1;31mERROR←[m] ←[1;31m1 required artifact is missing.←[m
←[1;31mERROR←[m] ←[1;31m←[m
←[1;31mERROR←[m] ←[1;31mfor artifact: ←[m
←[1;31mERROR←[m] ←[1;31m org.apache.maven.plugins:maven-downloader-plugin:jar:1.0←[m

Plugin com.tibco.plugins:bw6-maven-plugin:1.1.0 or one of its dependencies could not be resolved - BW6 maven plugin build issue

I am using BWCE Studio (2.1.0), BW6 maven plugin (1.1.0). When I try to build a BWCE application from Jenkins using the BW6 maven plugin, I get following error:
Jenkins Console Output:::
Started by user admin
Building in workspace C:\Program Files (x86)\Jenkins\workspace\bwce-app-build
C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
C:\Program Files\Git\bin\git.exe config remote.origin.url _https://github.com/RajibBiswasTibco/BWCEJenkins.git # timeout=10
Fetching upstream changes from _https://github.com/RajibBiswasTibco/BWCEJenkins.git
C:\Program Files\Git\bin\git.exe --version # timeout=10
C:\Program Files\Git\bin\git.exe fetch --tags --progress _https://github.com/RajibBiswasTibco/BWCEJenkins.git +refs/heads/:refs/remotes/origin/
C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 8d093265f7e348f79e506c905be3702abe41ec33 (refs/remotes/origin/master)
C:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10
C:\Program Files\Git\bin\git.exe checkout -f 8d093265f7e348f79e506c905be3702abe41ec33
C:\Program Files\Git\bin\git.exe rev-list 8d093265f7e348f79e506c905be3702abe41ec33 # timeout=10
Parsing POMs
Established TCP socket on 53491
[bwce-test-app.application.parent] $ java -cp "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-1.8.1.jar;C:\sw\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\sw\apache-maven-3.3.9/conf/logging" jenkins.maven3.agent.Maven33Main C:\sw\apache-maven-3.3.9 "C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-2.62.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-1.8.1.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.8.1.jar" 53491
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f C:\Program Files (x86)\Jenkins\workspace\bwce-app-build\bwce-test-app.application.parent\pom.xml clean package
[INFO] Scanning for projects...
[WARNING] The POM for com.tibco.plugins:bw6-maven-plugin:jar:1.1.0 is missing, no dependency information available
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin com.tibco.plugins:bw6-maven-plugin:1.1.0 or one of its dependencies could not be resolved: Failure to find com.tibco.plugins:bw6-maven-plugin:jar:1.1.0 in _https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced #
[ERROR] Unknown packaging: bwmodule # com.tibco.bw:bwce-test-app:[unknown-version], C:\Program Files (x86)\Jenkins\workspace\bwce-app-build\bwce-test-app\pom.xml, line 12, column 14
[ERROR] Unresolveable build extension: Plugin com.tibco.plugins:bw6-maven-plugin:1.1.0 or one of its dependencies could not be resolved: Failure to find com.tibco.plugins:bw6-maven-plugin:jar:1.1.0 in _https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced #
[ERROR] Unknown packaging: bwear # com.tibco.bw:bwce-test-app.application:[unknown-version], C:\Program Files (x86)\Jenkins\workspace\bwce-app-build\bwce-test-app.application\pom.xml, line 12, column 14
#
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]
[ERROR] The project com.tibco.bw:bwce-test-app:1.0.0-SNAPSHOT (C:\Program Files (x86)\Jenkins\workspace\bwce-app-build\bwce-test-app\pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin com.tibco.plugins:bw6-maven-plugin:1.1.0 or one of its dependencies could not be resolved: Failure to find com.tibco.plugins:bw6-maven-plugin:jar:1.1.0 in _https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
[ERROR] Unknown packaging: bwmodule # com.tibco.bw:bwce-test-app:[unknown-version], C:\Program Files (x86)\Jenkins\workspace\bwce-app-build\bwce-test-app\pom.xml, line 12, column 14
[ERROR]
[ERROR] The project com.tibco.bw:bwce-test-app.application:1.0.0-SNAPSHOT (C:\Program Files (x86)\Jenkins\workspace\bwce-app-build\bwce-test-app.application\pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin com.tibco.plugins:bw6-maven-plugin:1.1.0 or one of its dependencies could not be resolved: Failure to find com.tibco.plugins:bw6-maven-plugin:jar:1.1.0 in _https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
[ERROR] Unknown packaging: bwear # com.tibco.bw:bwce-test-app.application:[unknown-version], C:\Program Files (x86)\Jenkins\workspace\bwce-app-build\bwce-test-app.application\pom.xml, line 12, column 14
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] _http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] _http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException
channel stopped
Finished: FAILURE
The problem is that the maven local repositoty is different betweeen jenkins and maven.
You have 2 option:
You will update the configuration option(setting.xml) for maven in jenkins.
or
You copy this path C:\Users\$USER_NAME\.m2\repository\com\tibco\plugins\bw6-maven-plugin in the local repository for jenkins.

Riak 1.3.1 will not start on lucid, Ec2 instance

I have installed riak (apt-get) on an EC2 instance, lucid, amd64 with libssl.
When running riak start I get:
Attempting to restart script through sudo -H -u riak
Riak failed to start within 15 seconds,
see the output of 'riak console' for more information.
If you want to wait longer, set the environment variable
WAIT_FOR_ERLANG to the number of seconds to wait.
Running riak console:
Exec: /usr/lib/riak/erts-5.9.1/bin/erlexec -boot /usr/lib/riak/releases/1.3.1/riak
-embedded -config /etc/riak/app.config
-pa /usr/lib/riak/lib/basho-patches
-args_file /etc/riak/vm.args -- console
Root: /usr/lib/riak
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:2:2] [async-threads:64] [kernel-poll:true]
/usr/lib/riak/lib/os_mon-2.2.9/priv/bin/memsup: Erlang has closed.
Erlang has closed
{"Kernel pid terminated",application_controller,"{application_start_failure,riak_core, {shutdown,{riak_core_app,start,[normal,[]]}}}"}
Crash dump was written to: /var/log/riak/erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,riak_core, {shutdown,{riak_core_app,start,[normal,[]]}}})
The error logs:
2013-04-24 11:36:20.897 [error] <0.146.0> CRASH REPORT Process riak_core_handoff_listener with 1 neighbours exited with reason: bad return value: {error,eaddrinuse} in gen_server:init_it/6 line 332
2013-04-24 11:36:20.899 [error] <0.145.0> Supervisor riak_core_handoff_listener_sup had child riak_core_handoff_listener started with riak_core_handoff_listener:start_link() at undefined exit with reason bad return value: {error,eaddrinuse} in context start_error
2013-04-24 11:36:20.902 [error] <0.142.0> Supervisor riak_core_handoff_sup had child riak_core_handoff_listener_sup started with riak_core_handoff_listener_sup:start_link() at undefined exit with reason shutdown in context start_error
2013-04-24 11:36:20.903 [error] <0.130.0> Supervisor riak_core_sup had child riak_core_handoff_sup started with riak_core_handoff_sup:start_link() at undefined exit with reason shutdown in context start_error
I'm new to Riak and basically tried to run through the "Fast Track" docs.
None of the default core IP settings in the configs have been changed. They are still set to {http, [ {"127.0.0.1", 8098 } ]}, {handoff_port, 8099 }
Any help would be greatly appreciated.
I know this is old but there is some solid documentation about the errors in the crash.dump file on the Riak site.

Setup of flex units on linux

I am working on a project using Flex and until now we are using Windows to run flex unit tests for the modules/artifacts that require flex environment. Because of given dependencies, it is difficult to automatize anything because I have to swithch between linux/windows when running those maven tests.
I have made an effort to try to make flex units tests run on linux, but have not succedded [yet]. Here is small part of the stack trace from maven clean test -X on a flex project.
[INFO] Flexmojos 3.8
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Running tests /root/trunk/flex-project/flex-surface/flex-surface-common/flex-surface-common-flex/target/test-classes/TestRunner.swf
[DEBUG] [org.sonatype.flexmojos.test.monitor.AsVmPing] opened server socket on port 13540
[DEBUG] [org.sonatype.flexmojos.test.monitor.ResultHandler] opened server socket on port 13539
[DEBUG] [LAUNCHER] ASVmLauncher starting
[DEBUG] [LAUNCHER] exec: /usr/bin/flashplayer - /root/trunk/flex-project/flex-project-arbeidsflate/flex-surface-common/flex-surface-common-flex/target/test-classes/TestRunner.swf
[DEBUG] [LAUNCHER] Creating process
[WARNING] [LAUNCHER] Using xvfb-run to launch headless tests
[DEBUG] [LAUNCHER] Process created java.lang.UNIXProcess#1a6c088
[DEBUG] [MOJO] launcher RUNNING
[DEBUG] [MOJO] pinger STARTED
[DEBUG] [MOJO] resultHandler STARTED
[DEBUG] [LAUNCHER] Output pumpers ON
[DEBUG] [LAUNCHER] Waiting for flashplayer termination
[DEBUG] [LAUNCHER] Flashplayer closed
[DEBUG] [LAUNCHER] Unexpected return code 1
[DEBUG] [SYSERR]: mktemp: cannot create temp file /tmp/Xauthority: File exists
[DEBUG] [MOJO] launcher ERROR
[DEBUG] [MOJO] pinger STARTED
[DEBUG] [MOJO] resultHandler STARTED
[INFO] ------------------------------------------------------------------------
[INFO] Tests run: 0, Failures: 0, Errors: 0, Time Elapsed: 0 sec
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
I need help find out what is wrong. If any of you guys know any other way to run flex units test on linux, NOT THROUGH JENKINS/HUDSON, I will be extremely grateful.
First of all, just follow the linux part of the instructions on the following site:Running unit tests - FlexMojos. Download the flashplayer and untar it some appropriate place and put the absolute directory path in your PATH variable.
Download the xvfb-run script and change the following 'fi'
# If the user did not specify an X authorization file to use, set up a temporary
# directory to house one.
if [ -z "$AUTHFILE" ]; then
XVFB_RUN_TMPDIR="${TMPDIR:-/tmp}/$PROGNAME.$$"
if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then
error "temporary directory $XVFB_RUN_TMPDIR already exists"
exit 4
fi
AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority)
fi
to
# If the user did not specify an X authorization file to use, set up a temporary
# directory to house one.
if [ -z "$AUTHFILE" ]; then
XVFB_RUN_TMPDIR=$(mktemp -d)
if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then
error "temporary directory $XVFB_RUN_TMPDIR already exists"
exit 4
fi
AUTHFILE=$(mktemp "$XVFB_RUN_TMPDIR/Xauthority")
fi
I solved my problem, hopefully you will too.
Good luck.

Resources