Comments (17)
Changing "npm" to "npm.cmd" solved the issue for me
from exec-maven-plugin.
I guess the easiest way is to remove npm file (shell script) on Windows, so that it will find npm.cmd.
Makes no sense to have a Windows-specific command line in pom.xml.
from exec-maven-plugin.
We use the same POM in Windows and Linux, if I changed this, it would not run under Linux anymore.
from exec-maven-plugin.
Are you running on win32 based system (Windows XP or 32 Bit version of Windows 7 ?)
from exec-maven-plugin.
My environment is
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Maven home: D:\Programme\Java\apache-maven-3.3.3
Java version: 1.8.0_40, vendor: Oracle Corporation
Java home: D:\Programme\Java\java-8.0.40-win64-jdk\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
I'm running maven from cmd prompt and of course npm install
from the same cmd works fine.
from exec-maven-plugin.
Have you seen the error message:
CreateProcess error=193, %1 ist keine zulässige Win32-Anwendung
from exec-maven-plugin.
Yes I did, but calling the same from cmd promt works well and with version 1.5.0 also.
from exec-maven-plugin.
So with version 1.5.0 it works without any issue? have you tried to add the extension like (.exe ?)
from exec-maven-plugin.
Sorry typo, with 1.4.0 all is good, just switching version to 1.5.0 makes things break.
from exec-maven-plugin.
That may be, but it does not clarify, why it worked in 1.4.0...
from exec-maven-plugin.
@fjakop true, I forgot about that, I'll also need this to run on jenkins and peer developers machines.
from exec-maven-plugin.
The proposed fix works only on Windows, but will break Linux as it enforces the existence of file extensions, and the existence of the variable PATHEXT. Please correct it: Don't remove the top fast-success case, but make it conditional for non-Windows instead.
from exec-maven-plugin.
Could you set a milestone (1.6.0?) or label so people can understand why this is closed?
from exec-maven-plugin.
when is 1.6.0 getting added to Maven central?
from exec-maven-plugin.
See this which solve the problem through profiles: http://stackoverflow.com/a/39407412/704681
from exec-maven-plugin.
I know this is really old, but: The SO answer says it's fixed, but it doesn't seem to be. If I rename remove the npm file so that there is only npm.cmd left, it works with <executable>
set to npm. But if it exists, it breaks (with 'C:\Program' is not recognized as an internal or external command, operable program or batch file.
). Setting npm.cmd as the command is not an option for me. Profile would work, but I'd rather get this fixed really this time, than having another workaround.
So, is this a new or different bug or am I missing something?
from exec-maven-plugin.
@d0x7 I cannot reproduce your problem. I have set up a complete example from scratch on Windows 11 (64 Bit) and it worked for me out of the box using a fake npm.cmd
batch file which simply prints all given paramters to STDOUT:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eu.headcrashing</groupId>
<artifactId>exec-42</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<npm.registry>C:\foo\bar</npm.registry>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>npm install</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<commandlineArgs>install --registry ${npm.registry}</commandlineArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
mvn package
...
[INFO] --- exec-maven-plugin:3.1.0:exec (npm install) @ exec-42 ---
install --registry C:\foo\bar
This works as shown above without any other changes or tricks if npm.cmd
lives in the current working directory or if it is found on the Windows search path PATH
. It also should work perfectly using totally different / arbitrary locations of npm.cmd
as once as you specify that path using a toolchain.
I am sorry that it does not work for you, but apparently there seems to be something different in your case, so please tell us what that difference is.
from exec-maven-plugin.
Related Issues (20)
- Idea: Add dll dependencies to java.library.path
- Passing argument -p to java application HOT 1
- Module path can't be defined HOT 1
- An default visibility class, has main method, occurs error on execution HOT 2
- add third execution mode to enable jvm parameters such as --enable-preview HOT 4
- Plugin does not use jdk from toolchains plugin HOT 1
- IOException: Stream closed HOT 2
- Failing to execute goal after upgrading to Java 17 with ExecuteException HOT 1
- mavin plugin file HOT 1
- git submodule status fails with exec-maven-plugin:3.1.0 but succeeds with exec-maven-plugin:1.6.0:exec HOT 2
- Doing several invocations through exec:java? HOT 19
- New option 'blockSystemExit' for 'java' mojo
- Properly handle UnsupportedOperationException thrown by Thread::stop in JDK 20+ HOT 3
- XML DocumentBuilderFactory error after upgrade from 3.0.0 to 3.1.0 HOT 5
- setting MAVEN_OPTS in environment variables does not work
- how to pass command line arguments to exec:java as pom.xml variable/ parameter?
- Shell script execution using "basedir" as argument has problems in Windows
- NullPointerException under Maven 4.0.0-m10 HOT 2
- Add support for Implicitly Declared Classes and Instance Main Methods (Second Preview) OpenJDK JEP 463 HOT 3
- Execution of Windows batch script in path containing blank fails in combination with arguments with quotes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exec-maven-plugin.