modernweb-pl / wiremock-standalone Goto Github PK
View Code? Open in Web Editor NEWWireMock standalone CLI wrapper for node.js
WireMock standalone CLI wrapper for node.js
Hi folks,
I can't seem to pass -D options to the underlying java process that runs the jar from your commandline? I need to pass a custom system variable, say -Dmy.custom.var=localhost:9090? Is this possibly with your module?
Thanks,
Mark.
The install.js file is set in a deprecated "java 7" way.
const url =
${options.mavenRepoURL}/${mavenPath}/${version}/wiremock-standalone-${version}.jar;
This limits the last version to be 2.27.2.
Is it possible to be flexible enough to allow for the java 8 standalone pattern to be used as well.
https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.29.1/wiremock-jre8-standalone-2.29.1.jar
I am in need of the handlebar helpers that are found in the latter version.
I can't install wiremock due proxy config. I need set a proxy config to download https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/xxx/wiremock-standalone-xxx.jar
/node_modules/wiremock-standalone/install.js:37 throw new Error('Downloading WireMock jar from Maven Central failed: ${error}'); ^ Error: Downloading WireMock jar from Maven Central failed: connect ETIMEDOUT 151.101.132.209:443
I tried setting .nmv/jvm.config
I tried setting HOME/.m2/settings.xml
I tried exporting:
export http_proxy=http://x export https_proxy=http://x
But nothing... I can download from navigator the .jar , even do a curl...
Reading install.js I think it's necessary an option to set proxy setting, because http.get ignore all this options and environment vars...
Terminal: zsh
System: macOS Catalina (10.15.6)
node.js: 12.16.3
npm -v: 6.14.4
Upon there being no MAVEN_...
or WIREMOCK_VERSION
environment variables specified, the install.js
script fails with the:
Error: Cannot read property '1' of null
.
This is because the script attempts to determine the wiremock version from the maven-metadata.xml
file by the following regex pattern that expects the version between the release
tags to be 3 dot-separated numbers:
wiremock-standalone/install.js
Line 28 in 443ee52
Presently, the maven-metadata.xml
file returned has the release
version specified like so:
<release>3.0.0-beta-2</release>
This fails the match on the install.js
Line 28 pattern, making the .match(...)
return null
, finally, causing the error message mentioned above.
Current maven-metadata.xml
file:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-standalone</artifactId>
<versioning>
<latest>3.0.0-beta-2</latest>
<release>3.0.0-beta-2</release>
<versions>
<version>2.0.1-beta</version>
... etc (removing all in between to make this shorter)
<version>2.27.1</version>
<version>2.27.2</version>
<version>3.0.0-beta-1</version>
<version>3.0.0-beta-2</version>
</versions>
<lastUpdated>20221230190922</lastUpdated>
</versioning>
</metadata>
Created this Issue ticket, in case a different solution to that of PR #20 is wanted.
Hi @Hagith,
thank you for the updated version of the standalone.
I tried downloading the wiremock via an alternative repo and failed.
It seems that the basepath was changed from const mavenPath = 'com/github/tomakehurst/wiremock-standalone';
to const mavenPath = 'maven2/com/github/tomakehurst/wiremock-standalone';
in one of your latest commits.
So the installer tries to download from <MAVEN_REPO_URL>/maven2/com/github/tomakehurst/wiremock-standalone
.
My proxy sadly provides the artifact under the following url: <MAVEN_REPO_URL>/maven-central/com/github/tomakehurst/wiremock-standalone
and i have no way to change this.
Is it possible to move the /maven2
-prefix from the "mavenPath" to the "mavenRepoUrl"?
Thank you and Best Regards
Stephan
On version 3.1.2
when running install.js, I receieve the error
Downloading WireMock standalone from Maven Central...
https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/3.0.1/wiremock-jre8-standalone-3.0.1.jar
Error: Request failed with status code 404
Wiremock 3.0.0 came out yesterday, and it appears that wiremock 3 doesn't have a jar file.
https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/3.0.1/
perhaps you can use the latest version of wiremock 2
When using this library in a Windows environment and a terminal without curl support, the wiremock-standalone jar fails to download on npm install.
Workaround is to use some curl-enabled terminal on windows (like git bash), but it would be interesting to have it working on any chosen terminal.
error An unexpected error occurred: "C:\myrepo\node_modules\wiremock-standalone: Command failed.
Exit code: 1
Command: C:\Windows\system32\cmd.exe
Arguments: /d /s /c node install.js
Directory: C:\myrepo\node_modules\wiremock-standalone
Output:
Downloading WireMock standalone from Maven Central...
http://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/2.15.0/wiremock-standalone-2.15.0.jar
C:\myrepo\node_modules\wiremock-standalone\install.js:15
throw new Error('Downloading WireMock jar from Maven Central failed');
^Error: Downloading WireMock jar from Maven Central failed
at Object. (C:\myrepo\node_modules\wiremock-standalone\install.js:15:9)
at Module._compile (module.js:662:30)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)
at Function.Module.runMain (module.js:703:10)
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.