Skip to content

[Enchancement] Don't print stack trace as errer output. #96

@xycabcd

Description

@xycabcd

I think a stacktrace would not be useful to the user, and it also floods the console.
A long one for example. This whole thing will appear in the user's terminal if they mistyped the version number:

org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: org.springframework:spring-core:jar:lastest (absent): Could not find artifact org.springframework:spring-core:jar:lastest in central (https://repo.maven.apache.org/maven2/)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:365)
	at org.codejive.jpm.util.Resolver.resolveArtifacts(Resolver.java:83)
	at org.codejive.jpm.util.Resolver.resolve(Resolver.java:41)
	at org.codejive.jpm.util.Resolver.resolvePaths(Resolver.java:47)
	at org.codejive.jpm.Jpm.path(Jpm.java:229)
	at org.codejive.jpm.Main$PrintPath.call(Main.java:330)
	at org.codejive.jpm.Main$PrintPath.call(Main.java:313)
	at picocli.CommandLine.executeUserObject(CommandLine.java:2031)
	at picocli.CommandLine.access$1500(CommandLine.java:148)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2469)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2461)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2423)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2425)
	at picocli.CommandLine.execute(CommandLine.java:2174)
	at org.codejive.jpm.Main.main(Main.java:658)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: org.springframework:spring-core:jar:lastest (absent): Could not find artifact org.springframework:spring-core:jar:lastest in central (https://repo.maven.apache.org/maven2/)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:473)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:261)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:353)
	... 15 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.springframework:spring-core:jar:lastest in central (https://repo.maven.apache.org/maven2/)
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:42)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:417)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:260)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:537)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:449)
	... 17 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions