Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding a sourceDirectory configuration option #71

Closed
tmbrggmn opened this issue Jul 30, 2014 · 1 comment
Closed

Consider adding a sourceDirectory configuration option #71

tmbrggmn opened this issue Jul 30, 2014 · 1 comment

Comments

@tmbrggmn
Copy link

Consider the following scenario: I want to run Gulp tasks for an Angular project in a subdirectory in my Maven module, but I don't necessarily want to have Node.js installed (for whatever reason, each machine that runs the Maven project is responsible for setting up its own Node/NPM installation). In other words, I need to configure the workingDirectory option but I do not want to use the install-node-and-npm goal.

Apparently this is impossible right now. Using the workingDirectory option means that the plugin will look for the source files in that directory but it also looks for a node installation in that directory:

Caused by: java.io.IOException: Cannot run program "c:\bla\bla\src\node\node" (in directory "c:\bla\bla\src"): CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
        at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.executeAndRedirectOutput(ProcessExecutor.java:58)
        ... 24 more

Forgive me any ignorance on the subject, but I'd like to propose that the workingDirectory is split into 2 different options:

  • workingDirectory: the location where to install any runtime files, such as the node and NPM runtimes, regardless of source files.
  • sourceDirectory: the location where to find the actual project source files, regardless of Node/NPM binaries.

What do you think? This seems a little related to issue #18.

@eirslett
Copy link
Owner

I'm afraid you're out of luck - this plugin is very opiniated in that it insists - you have to let it install Node and npm for you, local to the project. (Which is half the point of the plugin) The reason why is that a local installation is more resistant to random build failures (like, for example, karma-runner/karma#558 - an error that occurs on only a few versions of Node that one of your developers happened to have installed). Also, it doesn't impose the requirement on all developers to have Node installed in order to build the project.

Individual developers often will have their own version of Node installed too, but just during the build process, the local Node.js version is used.

If you really want to run Gulp with every developer's unique version of Node (or lack thereof), then try the exec-maven-plugin. Like in this article, but with Gulp instead of Grunt:
http://addyosmani.com/blog/making-maven-grunt/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants