为了从package.json下载依赖项,我在POM中添加了以下插件:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>npm install (initialize)</id>
<goals>
<goal>exec</goal>
</goals>
<phase>initialize</phase>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
的package.json:
{
"name": "ptr_jsm_base",
"version": "1.0.0",
"description": "A starter Project",
"main": "config.js",
"directories": {
"test": "tests"
},
"dependencies": {
"jasmine-data-provider": "^2.2.0",
"jasmine-reporters": "^2.3.1",
"jasmine2-protractor-utils": "^1.3.0",
"jsonpath": "^1.0.0",
"oracledb": "^2.2.0",
"protractor": "^5.3.0",
"protractor-html-reporter": "^1.3.2",
"request-promise": "^4.2.2"
},
"devDependencies": {
"protractor-beautiful-reporter": "^1.2.1"
},
"scripts": {
"sanityDev": "protractor config.js --params.env=Developement --grep=ATsanity",
"sanityStage": "protractor config.js --params.env=Stage --grep=@sanity",
"smokeDev": "protractor config.js --params.env=Developement --grep=@smoke",
"smokeStage": "protractor config.js --params.env=Stage --grep=@smoke",
"stage": "protractor config.js --params.env=Stage",
"dev": "protractor config.js --params.env=Developement",
"webdriver-manager": "node node_modules/protractor/bin/webdriver-manager",
"webdriver-manager-start": "webdriver-manager update && webdriver-manager start"
}
}
&#13;
当我使用未在文件pachage.json级别创建的mvn clean install node-modules文件夹运行pom.xml时
如何通过maven下载所有依赖项?