Not a valid command: idea-shell (similar: shell, oldshell) - intellij-idea

I have trouble refreshing my SBT project in Intellij. And I am not the only one.
This is the sbt-console:
/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=localhost:51917,suspend=n,server=y -Xdebug -server -Xmx1028M -Dfile.encoding=UTF-8 -Didea.runid=2017.2 -Didea.managed=true -jar "/Users/pascal.mengelt/Library/Application Support/IntelliJIdea2018.1/Scala/launcher/sbt-launch.jar" idea-shell
Listening for transport dt_socket at address: 51917
[info] Loading settings from idea.sbt ...
[info] Loading global plugins from /Users/user/.sbt/1.0/plugins
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /Users/pascal.mengelt/GitHub/scala/scala-adapters-wizard/project
[info] Loading settings from build.sbt ...
[info] Set current project to wizardDemo (in build file:/Users/pascal.mengelt/GitHub/scala/scala-adapters-wizard/)
[error] Not a valid command: idea-shell (similar: shell, oldshell)
[error] Not a valid project ID: idea-shell
[error] Expected ':'
[error] Not a valid key: idea-shell (similar: daemonShell)
[error] idea-shell
[error] ^
[INFO] [04/13/2018 13:13:19.377] [Thread-2] [CoordinatedShutdown(akka://sbt-web)] Starting coordinated shutdown from JVM shutdown hook

I found the Intellij issue for that (with workaround):
SCL-12430 Not a valid key: idea-shell
Yes ,delete the ~/.sbt/{0.13|1.0}/plugins/target
Here the command provided by Mateusz Kubuszok:
rm -rf ~/.sbt/{0.13,1.0}/plugins/target

Related

Maven - doesnt download from https://repo1.maven.org/maven2 but trying to download from http://repo1.maven.org/maven2

I m trying to run mvn site. I tried even running dependency tree. But still i m getting the following error on console. Ideally it should fetch from https and not from http. How do we get the maven from downloading from https and not from http ?
D:\Junit\junit5-examples-master\junit5-maven>mvn site
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.mkyong.core:junit5-maven >--------------------
[INFO] Building junit5-maven 1.0
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-report-plugin/3.0.0-M4/maven-surefire-r
eport-plugin-3.0.0-M4.pom
Downloading from org.source.repo: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-report-plugin/3.0.0-M4/maven-s
urefire-report-plugin-3.0.0-M4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.063 s
[INFO] Finished at: 2020-01-20T17:14:59+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project junit5-maven: Could not resolve dependencies for project com.mkyong.core:junit5-maven:jar:1.0
: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-report-plugin:jar:3.0.0-M4: Failed to read artifact descrip
tor for org.apache.maven.plugins:maven-surefire-report-plugin:jar:3.0.0-M4: Could not transfer artifact org.apache.maven.plugins:maven-
surefire-report-plugin:pom:3.0.0-M4 from/to central (http://repo1.maven.org/maven2/): Failed to transfer file http://repo1.maven.org/ma
ven2/org/apache/maven/plugins/maven-surefire-report-plugin/3.0.0-M4/maven-surefire-report-plugin-3.0.0-M4.pom with status code 501 -> [
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/DependencyResolutionException
Pl assist.
Regards,

JSS7 - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin

On Ubuntu 16.04 I am installing JSS7 as per https://github.com/RestComm/jss7/wiki/Build-jSS7-from-Source
On Step 7 I get this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project scheduler: Compilation failure: Compilation failure:
[ERROR] error: Source option 5 is no longer supported. Use 6 or later.
[ERROR] error: Target option 1.5 is no longer supported. Use 1.6 or later.
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :scheduler
I am new at this any suggestions as to what this means and how to fix it?
More details:
mvn clean install -Dmaven.test.skip=true
fails with error
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:37 min
[INFO] Finished at: 2018-10-01T12:23:32-06:00
[INFO] Final Memory: 50M/89M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project scheduler: Compilation failure: Compilation failure:
[ERROR] error: Source option 5 is no longer supported. Use 6 or later.
[ERROR] error: Target option 1.5 is no longer supported. Use 1.6 or later.
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :scheduler
Followed instructions on
https://github.com/RestComm/jss7/wiki/Build-jSS7-from-Source
Fails when executing step 7 - Build jSS7
with maven : mvn clean install -Dmaven.test.skip=true
hardware configuration: HP Elite Desktop 00 G1
OS: UBuntu 18.04
Kernel (e.g. uname -a): Linux stc0042223 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Deployment method (e.g. application server version + config + method): Direct install on desktop
Package: maven
Architecture: all
Version: 3.5.2-2
Priority: optional
Section: universe/java
Origin: Ubuntu
mvn -version
Apache Maven 3.5.2
Maven home: /usr/share/maven
Java version: 10.0.2, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-10-oracle
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-36-generic", arch: "amd64", family: "unix"

Connection timing out while connecting to Maven repository

I am trying to build my project in my local system using the below command
mvn clean install -Dmaven.test.skip=true
It fails with the below error. It is failing to connect to repo.maven.apache.org.
I pinged to the server repo.maven.apache.org, I can see the response back.
I am using maven 3 version and connecting to maven 2 repo (repo.maven.apache.org).
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building web-order-avpn 1702.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: **https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom**
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.778 s
[INFO] Finished at: 2017-01-19T21:21:10-06:00
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its
dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5:
Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central
(https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.56.215] failed: Connection timed out: connect -> [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/PluginResolutionException
Would be great if some one can suggest on what is wrong with my system?
I had this same issue and just like the comments suggested it was the maven proxy. Setup in \conf\settings.xml
http://maven.apache.org/guides/mini/guide-proxies.html

How to run javaee7 sdk samples?

My teacher want me to run javaee7 sdk sample "annotation-war". Then I download the javaee7 sdk from http://www.oracle.com/technetwork/java/javaee/downloads/index.html. But, I don't know how to run it.
I have tried the following steps:
First, I import code into Intelij IDEA, and run mvn cargo:run, but some error happen
"C:\Program Files\Java\jdk1.8.0_101\bin\java" -Dmaven.multiModuleProjectDirectory=C:\zjf\code\IDEA\javaee_samples\servlet\annotation-war -Dmaven.home=C:\zjf\soft\apache-maven-3.3.9 -Dclassworlds.conf=C:\zjf\soft\apache-maven-3.3.9\bin\m2.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\zjf\soft\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.3 -s C:\zjf\soft\apache-maven-3.3.9\conf\settings.xml -Dmaven.repo.local=C:\zjf\soft\apache-maven-3.3.9\repo org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building annotation-war 4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.0:run (default-cli) # annotation-war ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.422 s
[INFO] Finished at: 2016-12-06T19:12:34+08:00
[INFO] Final Memory: 8M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project annotation-war: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish4x], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [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/PluginExecutionException
Process finished with exit code 1
Then I think may be I have done the wrong thing, so I read the docs in "annotation-war". It's ok to run mvn clean and mvn verify. But when I run mvn cargo:run -Dglassfish.home=C:\zjf\soft\glassfish, I still encounter the same problem:
C:\zjf\code\IDEA\javaee_samples\servlet\annotation-war>mvn cargo:run -Dglassfish.home=C:\zjf\soft\glassfish
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building annotation-war 4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.0:run (default-cli) # annotation-war ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.038 s
[INFO] Finished at: 2016-12-06T20:59:57+08:00
[INFO] Final Memory: 8M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project annotation-war: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish4x], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [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/PluginExecutionException
I really don't know how to run javaee SDK samples. Can anyone who know how to run it give me some help?
The simplest way to get it running is to first build the project with mvn install which will output a WAR file. The bottom of the log will tell you the full, absolute path to the WAR file. the install Maven goal will also put copy it to your local repository which is managed by Maven, so you will see two different paths to the same WAR file. Either of these works, e.g:
/path/to/my/app/target/annotation-war-1.0.0-SNAPSHOT.war
You can then use the asadmin tool in GlassFish to deploy the WAR file, first making sure GlassFish is running:
C:\zjf\soft\glassfish\glassfish4\bin\asadmin start-domain
C:\zjf\soft\glassfish\glassfish4\bin\asadmin deploy /path/to/my/app/target/annotation-war-1.0.0-SNAPSHOT.war
This isn't the only way to get it running (there are many) but you may find this is the easiest to undestand, with the fewest things that might go wrong, despite it being a bit long-winded.

What could be causing 'error transferring file' in maven?

I have installed maven 2.2.1 on my debian machine and getting the following error
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file: repository.exoplatform.org
What I have been able to find relating to this problem is its typically caused by not having proxy settings correctly configured or a firewall blocking traffic, but I dont have either on this machine. Also, I have the same settings file on my windows machine and it works fine.
Any suggestions would be greatly appreciated as I am stumped.
exo#melb-web:~/test$ mvn -v
Apache Maven 2.2.1 (r801777; 2009-08-07 05:16:01+1000)
Java version: 1.5.0_22
Java home: /usr/local/bin/jdk1.5.0_22/jre
Default locale: en_AU, platform encoding: UTF-8
OS name: "linux" version: "2.6.22-3-amd64" arch: "i386" Family: "unix"
exo#melb-web:~/test$ mvn archetype:generate
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file: repository.exoplatform.org
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Jun 30 10:18:33 EST 2010
[INFO] Final Memory: 2M/136M
[INFO] ------------------------------------------------------------------------
* EDIT *
I tried removing the settings.xml and generating a new maven project. I got the following
exo#melb-web:~/test$ mvn archetype:generate
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file: repo1.maven.org
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Jun 30 11:40:26 EST 2010
[INFO] Final Memory: 1M/136M
[INFO] ------------------------------------------------------------------------
I think this rules out it being a problem with the settings.xml or a pom. Is there a way to get more information about why maven cant connect to the repository?
I've tried the same commands and get the same error message, so I've run using the debug flag. This gives a different root exception depending on the proxy settings etc.
Try running the same in case you get better verbose output.
mvn -X archetype:generate
Case 1:
Machine not connected to network (Cable disabled) gives a debug message
[DEBUG] Exception
org.apache.maven.wagon.TransferFailedException: Error transferring file
...
Caused by: java.net.UnknownHostException: repo1.maven.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
[INFO] Repository 'central' will be blacklisted
Case 2:
Machine connected with incorrect proxy gives the debug message
[DEBUG] Exception
org.apache.maven.wagon.TransferFailedException: Error transferring file
...
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
[INFO] Repository 'central' will be blacklisted
Here error could be 403, connection reset or Authorization or access forbidden error
Case 3:
Machine with direct connection to internet
[DEBUG] Trying repository central
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archet
ype-plugin/2.0-alpha-5/maven-archetype-plugin-2.0-alpha-5.jar
[DEBUG] Artifact resolved
[INFO] ------------------------------------------------------------------------
and so on till it works.
Just to close the loop on this one - it turned out to be an issue with the libraries debian had available for java uses to resolve hostnames. The fix is to apply a new libdns for java as described here http://www.ehow.com/how_4747553_fix-unknownhostexception-java-applications-ubuntu.html. Once I did this I am able to run mvn with jdk5 and jdk6.
I would guess it has something to do with the repository settings in the pom, a parent pom or in your ~/.m2/settings.xml file. Its also possible that the repo at exoplatform is misconfigured.
With no repositories set the archetype plugin would come from repo1.maven.org
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/
I had the same problem. In my case it was actually a leftover settings.xml file from a prior job. I backed up and removed ~/.m2/settings.xml and the build went through just fine.
Update to maven 3.0.4 or up, if possible.
I've studied the maven source code: There is a bootstrap problem inside maven 2.2.1. The proxy is looked up as HTTPS when accessing HTTPS servers, but you only can have one proxy as active. There is no fallback to HTTP proxy. In maven 3.0.4 this issue seems to be solved.
The quick "solution" is to give fully qualified plugin name in the command :
mvn org.mortbay.jetty:maven-jetty-plugin:run
Don't forget to turn off your VPN especially for Chinese people. It's an SSL handshake issue.