Closed deshazer72 closed 6 years ago
You seem to be missing the call to mvn.create()
which is necessary to initialize the Maven wapper correctly.
Example:
const mvn = require ("maven").create();
mvn.execute(/*...*/);
I think the documentation in README.md is quite clear about that.... hopefully.... ;-)
sorry you are correct I was thrown off by the other parameters not know what to pass there I am still getting errors but I think it is because I am not using the package correctly
so after I put on some debugging I seen some of my issues which I dont understand I did this on the create
const mvn = require('maven').create({
debug: true,
generatePom: false,
repositoryId: 'internal-repository'
});
then this on my code to execute
function sendZipToNexus() {
const newdirName = 'c:\toolbox\RapVideoUpload\sco-rap-video-upload\dist\';
const appName = 'RapVideoUpload';
const groupId = 'com.sco.rapvideozip';
const appVersion = '0.0.2-SNAPSHOT';
const appPackaging = 'zip';
const appRepositoryUrl = 'repo';
const appLocation = newdirName + 'videos.zip';
console.log(appRepositoryUrl);
console.log(appLocation);
mvn.execute(['deploy:deploy-file'], {'artifactId': ${appName}
}, {'url': ${appRepositoryUrl}
}, {'file': ${appLocation}
}, {'groupId': ${groupId}
}, {'version': ${appVersion}
}, {'packaging': ${appPackaging}
});
this is my error
![image](https://cloud.githubusercontent.com/assets/20157793/25107602/09aa1ddc-2396-11e7-8902-d6d22d9b9ca7.png)
it sasys I am not passing these but I am. I also noticed that on remote repositoryId = remote-repository when I am setting that to 'internal-repository'
![image](https://cloud.githubusercontent.com/assets/20157793/25107641/43ee0d28-2396-11e7-9f0f-8a36b8d58cf5.png)
Ooops. Sorry for this very late reply...
It seems as if you are using the API in a very ... errr... unexpected/wrong way. ;-)
The correct way to invoke Maven would have been:
const mvn = require('maven').create({
debug: true
});
mvn.execute([ 'clean', 'install' ], {
generatePom: false,
repositoryId: 'internal-repository'
});
Thus: defines must be passed to the execute-call instead to the create call.
Again: Sorry for the very late reply. I am now closing this ticket, because I assume there is no "bug" to be hunted.
This may not be an error it could be just because I am not using maven correctly. I am trying to put a zip file that I create inside a repository by using maven
this is my code
when I run this I get mvn.execute is not a function..... and I am lost here I have written a .sh script that runs fine but what I am wanting to do is after someone upload a video and I create a zip of that video I want to put it in my repository automatically same thing as when they delete it and this mvn command does this for me with my .sh script
I am thinking I may be using the command wrong if I am I apologize I just do not see what I am doing wrong by looking at the documentation.