jdillon / mvnsh Goto Github PK
View Code? Open in Web Editor NEWMaven Shell
License: Other
Maven Shell
License: Other
I get the following error when running mvn install
on this project (any ideas why?):
[WARNING] Could not transfer metadata com.planet57.gshell:gshell:3.0.0-SNAPSHOT/maven-metadata.xml from/to ${public.serverId} (${public-snapshot.url}): No connector available to access repository ${public.serverId} (${public-snapshot.url}) of type default using the available factories WagonRepositoryConnectorFactory
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.planet57.maven.shell:mvnsh:1.2.0-SNAPSHOT (/home/chronos/Documents/mvnsh/pom.xml) has 1 error
[ERROR] Non-resolvable import POM: Could not transfer artifact com.planet57.gshell:gshell:pom:3.0.0-SNAPSHOT from/to ${public.serverId} (${public-snapshot.url}): No connector available to access repository ${public.serverId} (${public-snapshot.url}) of type default using the available factories WagonRepositoryConnectorFactory @ line 85, column 19 -> [Help 2]
[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/UnresolvableModelException
Would it be possible to somehow get completion similar to https://github.com/juven/maven-bash-completion in mvnsh?
pwd shows me a different path than where the program thinks I am:
mvnsh(/):mvnsh> pwd
C:\vcs\git\github\jdillon\mvnsh
I am expecting:
mvnsh(C:\vcs\git\github\jdillon\mvnsh):mvnsh>
Or something like that.
Is there anyone can tell me something about the script syntax?
And how to invoke the commands linke this "repository Command group: repository"?
Reason: Maven executable not found at: /home/rmannibucau/softwares/mvnsh-1.2.0-SNAPSHOT/bin/mvn
to solve that, mvnsh could add a mvn script (should be easy) in bin/? Alternative is to make invoker plugin supporting another maven home transparently but it requires a built in extension which is a bit more fragile (setting mavenExecutable using M2_HOME probably)
Workaround:
<profile>
<id>mvnsh</id>
<activation>
<file>
<exists>${maven.home}/bin/mvnsh</exists>
</file>
</activation>
<properties>
<maven.executable.location>${maven.home}/bin/mvnx</maven.executable.location>
</properties>
</profile>
and in maven-invoker-plugin:
<mavenExecutable>${maven.executable.location}</mavenExecutable>
There is some activity on the project again. It would be really nice to see a roadmap in the wiki or a blog post.
Using mvnsh-assembly-1.2.0-20170425.065527-18-bin.zip I get this at startup:
$ mvnsh
Maven Shell (1.2.0-SNAPSHOT,201704250654)
Type 'help' for more information.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
[INFO] Error reloading history file: /home/manfred/.m2/mvnsh.history
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at org.jline.reader.impl.history.DefaultHistory.lambda$load$0(DefaultHistory.java:80)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at org.jline.reader.impl.history.DefaultHistory.load(DefaultHistory.java:78)
at org.jline.reader.impl.history.DefaultHistory.attach(DefaultHistory.java:66)
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:464)
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:383)
at com.planet57.gshell.console.Console.work(Console.java:105)
at com.planet57.gshell.console.Console.run(Console.java:83)
at com.planet57.gshell.shell.ShellImpl.run(ShellImpl.java:247)
at com.planet57.gshell.MainSupport.boot(MainSupport.java:310)
at com.planet57.maven.shell.Main.main(Main.java:51)
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 com.planet57.gshell.launcher.Launcher.launch(Launcher.java:74)
at com.planet57.gshell.launcher.Launcher.run(Launcher.java:46)
at com.planet57.gshell.launcher.Launcher.main(Launcher.java:37)
mvnsh(/):mvnsh> cd \vcs
java.lang.ExceptionInInitializerError
On Windows.
Then:
mvnsh(/):mvnsh> cd /vcs
java.lang.NoClassDefFoundError: Could not initialize class com.planet57.gshell.util.io.FileAssert$Messages
I have a "C:\vcs" folder
This works OK:
mvnsh(/):mvnsh> cd c:\vcs
How to use?
give a link in README
After running 123 mvn install:install-file
commands I always get getting this error
java.lang.UnsatisfiedLinkError: C:\TEMP\jline\jline6839375240983950276.dll: A dynamic link library (DLL) initialization routine failed
java.lang.UnsatisfiedLinkError: C:\TEMP\jline\jline6426628542205626973.dll: A dynamic link library (DLL) initialization routine failed
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1062)
at jline.internal.NativeLibrary.load(NativeLibrary.java:107)
at jline.WindowsTerminal.init(WindowsTerminal.java:88)
at jline.TerminalSupport.reset(TerminalSupport.java:53)
at org.sonatype.gshell.console.Console.run(Console.java:148)
at org.sonatype.gshell.shell.ShellImpl.run(ShellImpl.java:292)
at org.sonatype.gshell.MainSupport.boot(MainSupport.java:286)
at org.sonatype.maven.shell.Main.main(Main.java:71)
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:606)
at org.sonatype.maven.shell.launcher.Launcher.launch(Launcher.java:75)
at org.sonatype.maven.shell.launcher.Launcher.run(Launcher.java:48)
at org.sonatype.maven.shell.launcher.Launcher.main(Launcher.java:39)
WARNING: Abnormal JVM shutdown detected
Windows 7 x64
mvnsh 1.1.0
mvn 3.0.5
When I execute mvn install
from the latest master code I get the following error:
[ERROR] Failed to execute goal org.sonatype.maven.plugins:maven-sisu-assembler-plugin:1.0.7:generate (default) on project mvnsh-maven: Execution default of goal org.sonatype.maven.plugins:maven-sisu-assembler-plugin:1.0.7:generate failed: Plugin org.sonatype.maven.plugins:maven-sisu-assembler-plugin:1.0.7 or one of its dependencies could not be resolved: Failure to find org.eclipse:org.eclipse.osgi:jar:3.7.0.v20100910 in http://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 1]
System info:
$ mvn -version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T14:51:42+01:00)
Maven home: /usr/local/Cellar/maven/3.2.2/libexec
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"
I can hardly see dir listings in Windows due to dark blue on black color.
Just curious if this project is being maintained or not. I only heard good things about it, but yet no updates in a couple of years?
Anyways, is there anyways I can easily upgrade the version of Maven used?
Thanks!
It would be very natural to have mvn shell
to start shell, instead of local build.
Could you please publish to Maven Central.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Maven Shell ....................................... SUCCESS [22.121s]
[INFO] Maven Shell Commands .............................. SUCCESS [10.385s]
[INFO] Maven Shell Commands :: Maven ..................... FAILURE [45.871s]
[INFO] Maven Shell Commands :: Archetype ................. SKIPPED
[INFO] Maven Shell Commands :: Nexus ..................... SKIPPED
[INFO] Maven Shell :: Bootstrap .......................... SKIPPED
[INFO] Maven Shell :: Personality ........................ SKIPPED
[INFO] Maven Shell Dist .................................. SKIPPED
[INFO] Maven Shell Dist :: Maven Extensions .............. SKIPPED
[INFO] Maven Shell Dist :: Assembly ...................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:35.807s
[INFO] Finished at: Thu Mar 12 21:41:02 MSK 2015
[INFO] Final Memory: 19M/65M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.maven.plugins:maven-sisu-assembler-plugin:1.0.7:generate (default) on project mvnsh-maven: Execution default of goal org.sonatype.maven.plugins:maven-sisu-assembler-plug
in:1.0.7:generate failed: Plugin org.sonatype.maven.plugins:maven-sisu-assembler-plugin:1.0.7 or one of its dependencies could not be resolved: Could not find artifact org.eclipse:org.eclipse.osgi:jar:3.7.0.v20100
910 in central (http://repo.maven.apache.org/maven2) -> [Help 1]
If not done several extensions don't work with mvnsh, a better solution would be to support both depending the build but it is harder than staying aligned on mvn defaults.
Potential implementation:
public class Slf4jLoggingSystem implements LoggingSystem {
private static final List<Level> ALL_LEVELS = ImmutableList.of(
Level.ALL,
Level.TRACE,
Level.DEBUG,
Level.INFO,
Level.WARN,
Level.ERROR,
Level.OFF
);
private static final List<LevelComponent> LEVELS = ALL_LEVELS.stream()
.map(Level::name)
.map(LevelComponentImpl::new)
.collect(toList());
private final ConcurrentMap<String, LoggerComponent> loggers = new ConcurrentHashMap<>();
@Override
public LevelComponent getLevel(final String name) {
checkNotNull(name);
return LEVELS.stream().filter(it -> it.getName().equalsIgnoreCase(name)).findFirst()
.orElseThrow(() -> new IllegalArgumentException("No level " + name));
}
@Override
public Collection<? extends LevelComponent> getLevels() {
return LEVELS;
}
@Override
public LoggerComponent getLogger(final String s) {
return loggers.computeIfAbsent(s, k -> {
final Logger logger = LoggerFactory.getLogger(k);
return new LoggerComponentImpl(logger, findLevel(logger));
});
}
private LevelComponent findLevel(final Logger logger) {
if (logger.isTraceEnabled()) {
return getLevel("TRACE");
}
if (logger.isDebugEnabled()) {
return getLevel("DEBUG");
}
if (logger.isInfoEnabled()) {
return getLevel("INFO");
}
if (logger.isWarnEnabled()) {
return getLevel("WARN");
}
if (logger.isErrorEnabled()) {
return getLevel("ERROR");
}
return getLevel("OFF");
}
@Override
public Collection<String> getLoggerNames() {
return loggers.keySet();
}
@Override
public Collection<? extends LoggingComponent> getComponents() {
return emptyList();
}
private static class LevelComponentImpl implements LevelComponent {
private final String level;
private LevelComponentImpl(final String name) {
this.level = name.toUpperCase(ROOT);
}
@Override
public String getName() {
return level;
}
}
private static class LoggerComponentImpl implements LoggerComponent {
private final Logger logger;
private final LevelComponent level;
private LoggerComponentImpl(final Logger logger, final LevelComponent level) {
this.logger = logger;
this.level = level;
}
@Override
public String getName() {
return logger.getName();
}
@Override
public LevelComponent getLevel() {
return level;
}
@Override
public void setLevel(final LevelComponent levelComponent) {
// no-op
}
@Override
public void setLevel(final String s) {
// no-op
}
@Override
public boolean isRoot() {
return "".equals(getName()) || "ROOT".equals(getName());
}
}
}
Please install our new product, Sonatype Lift with advanced features
Why do I use mvnsh?what problems did it solve compared to other products or native maven?
Downloaded: https://repo.maven.apache.org/maven2/org/sonatype/p2/bridge/p2-runtime/1.0.7/p2-runtime-1.0.7.zip (5073 KB at 951.5 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Maven Shell ........................................ SUCCESS [ 18.876 s]
[INFO] Maven Shell Commands ............................... SUCCESS [ 5.982 s]
[INFO] Maven Shell Commands :: Maven ...................... FAILURE [01:13 min]
[INFO] Maven Shell Commands :: Archetype .................. SKIPPED
[INFO] Maven Shell Commands :: Nexus ...................... SKIPPED
[INFO] Maven Shell :: Bootstrap ........................... SKIPPED
[INFO] Maven Shell :: Personality ......................... SKIPPED
[INFO] Maven Shell Dist ................................... SKIPPED
[INFO] Maven Shell Dist :: Maven Extensions ............... SKIPPED
[INFO] Maven Shell Dist :: Assembly ....................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:52 min
[INFO] Finished at: 2016-06-09T13:19:13+03:00
[INFO] Final Memory: 27M/239M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.maven.plugins:maven-sisu-assembler-plugin:1.0.7:generate (default) on project mvnsh-maven: Execution default of goal org.sonatype.maven.plugins:maven-sisu-assembler-plugin:1.0.7:generate failed: Plugin org.sonatype.maven.plugins:maven-sisu-assembler-plugin:1.0.7 or one of its dependencies could not be resolved: Could not find artifact org.eclipse:org.eclipse.osgi:jar:3.7.0.v20100910 in central (https://repo.maven.apache.org/maven2) -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :mvnsh-maven
I would like to control mvnsh by sending commands to the process from scripts. For example if I have the mvnsh process id of 18450 then I would send a command to standard in like:
printf "mvn package\n" > /proc/18450/fd/0
However this only echoes "mvn package" to the mvnsh terminal followed by a line feed. This makes sense because standard in points to the terminal for the mvnsh process.
Can mvnsh be configured to read commands from a named pipe instead? This way one could script commands to the mvnsh process and still be able to eliminate JVM boot time.
I just pulled the latest and built locally. When I run, I get:
Maven Shell (1.2.0-SNAPSHOT,201704252044)
Type 'help' for more information.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[INFO] Error reloading history file: C:\Users\ggregory\.m2\mvnsh.history
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at org.jline.reader.impl.history.DefaultHistory.lambda$load$0(DefaultHistory.java:80)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at org.jline.reader.impl.history.DefaultHistory.load(DefaultHistory.java:78)
at org.jline.reader.impl.history.DefaultHistory.attach(DefaultHistory.java:66)
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:464)
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:383)
at com.planet57.gshell.console.Console.work(Console.java:105)
at com.planet57.gshell.console.Console.run(Console.java:83)
at com.planet57.gshell.shell.ShellImpl.run(ShellImpl.java:247)
at com.planet57.gshell.MainSupport.boot(MainSupport.java:310)
at com.planet57.maven.shell.Main.main(Main.java:51)
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 com.planet57.gshell.launcher.Launcher.launch(Launcher.java:74)
at com.planet57.gshell.launcher.Launcher.run(Launcher.java:46)
at com.planet57.gshell.launcher.Launcher.main(Launcher.java:37)```
For example "cd /foo" completes to "cd /foobar".
When I run mvn clean install using my standard installation of maven everything works fine. As soon as I use the command in mvnsh, it throws an error telling me that annotations are not supported when compiling against java version 1.3.
I did a clean of Maven thru Homebrew and then installed mvnsh. When I call mvnsh I get this warning...
$mvnsh
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.converters.collections.TreeMapConverter (file:/usr/local/Cellar/maven-shell/1.1.0/libexec/lib/mvnsh/xstream-1.4.4.jar) to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.converters.collections.TreeMapConverter
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Sonatype Maven Shell (1.1.0,201304261627)
Type 'help' for more information.
-------------------------------------------------------------------------------------------------------------------------------------------
$mvnsh --illegal-access=warn
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.converters.collections.TreeMapConverter (file:/usr/local/Cellar/maven-shell/1.1.0/libexec/lib/mvnsh/xstream-1.4.4.jar) to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.converters.collections.TreeMapConverter
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
org.sonatype.gshell.command.registry.NoSuchCommandException: --illegal-access=warn
at org.sonatype.gshell.execute.CommandExecutorImpl.createAction(CommandExecutorImpl.java:129)
at org.sonatype.gshell.execute.CommandExecutorImpl.execute(CommandExecutorImpl.java:144)
at org.sonatype.gshell.execute.CommandExecutorImpl.execute(CommandExecutorImpl.java:117)
at org.sonatype.gshell.shell.ShellImpl.execute(ShellImpl.java:224)
at org.sonatype.gshell.MainSupport.boot(MainSupport.java:283)
at org.sonatype.maven.shell.Main.main(Main.java:71)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.sonatype.maven.shell.launcher.Launcher.launch(Launcher.java:75)
at org.sonatype.maven.shell.launcher.Launcher.run(Launcher.java:48)
at org.sonatype.maven.shell.launcher.Launcher.main(Launcher.java:39)
WARNING: Abnormal JVM shutdown detected
$mvn -v
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T11:41:47-07:00)
Maven home: /usr/local/Cellar/maven/3.6.0/libexec
Java version: 11.0.1, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.6", arch: "x86_64", family: "mac"
I've got a recommendation at Apache Maven mailing list to look at your project, but it doesn't build as far as I can tell.
mvnsh$ git log | head -n 3
commit 06a25d4240a87c6f6e972db3239d56125ddb95b0
Author: Jason Dillon <[email protected]>
Date: Wed Aug 15 12:39:39 2018 -0700
mvnsh$ JAVA_HOME=~/bin/jdk-8 ./build rebuild
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.planet57.maven.shell:mvnsh:1.2.0-SNAPSHOT: Failure to find com.planet57.buildsupport:public-parent:pom:2-SNAPSHOT in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of ossrh has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 24, column 11
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.