right click pom.xml to generate effective-pom

This commit is contained in:
Yan Zhang 2017-11-22 13:54:42 +08:00 коммит произвёл Yan Zhang
Родитель 6a67541ba7
Коммит e2bb8025fa
2 изменённых файлов: 40 добавлений и 17 удалений

Просмотреть файл

@ -28,6 +28,7 @@
{
"command": "mavenProjects.refresh",
"title": "Refresh",
"category": "Maven",
"icon": {
"light": "resources/light/refresh.svg",
"dark": "resources/dark/refresh.svg"
@ -35,55 +36,68 @@
},
{
"command": "mavenGoal.exec",
"title": "Execute"
"title": "Execute",
"category": "Maven"
},
{
"command": "mavenGoal.clean",
"title": "clean"
"title": "clean",
"category": "Maven"
},
{
"command": "mavenGoal.validate",
"title": "validate"
"title": "validate",
"category": "Maven"
},
{
"command": "mavenGoal.compile",
"title": "compile"
"title": "compile",
"category": "Maven"
},
{
"command": "mavenGoal.test",
"title": "test"
"title": "test",
"category": "Maven"
},
{
"command": "mavenGoal.package",
"title": "package"
"title": "package",
"category": "Maven"
},
{
"command": "mavenGoal.verify",
"title": "verify"
"title": "verify",
"category": "Maven"
},
{
"command": "mavenGoal.install",
"title": "install"
"title": "install",
"category": "Maven"
},
{
"command": "mavenGoal.site",
"title": "site"
"title": "site",
"category": "Maven"
},
{
"command": "mavenGoal.deploy",
"title": "deploy"
"title": "deploy",
"category": "Maven"
},
{
"command": "mavenGoal.custom",
"title": "custom goals ... "
"title": "custom goals ... ",
"category": "Maven"
},
{
"command": "mavenProject.effectivePom",
"title": "Effective POM"
"title": "Effective POM",
"category": "Maven"
},
{
"command": "mavenProject.openPom",
"title": "Open POM file"
"title": "Open POM file",
"category": "Maven"
}
],
"views": {
@ -95,6 +109,15 @@
]
},
"menus": {
"explorer/context": [
{
"command": "mavenArchetype.generate"
},
{
"command": "mavenProject.effectivePom",
"when": "resourceFilename == pom.xml"
}
],
"view/title": [
{
"command": "mavenProjects.refresh",

Просмотреть файл

@ -30,11 +30,11 @@ export function activate(context: vscode.ExtensionContext) {
Utils.runInTerminal(`mvn ${item.label} -f "${item.pomXmlFilePath}"`, true, `Maven-${item.params.projectName}`);
});
let commandMavenProjectEffectivePom = vscode.commands.registerCommand('mavenProject.effectivePom', (projectItem) => {
const item = projectItem as MavenProjectTreeItem;
const filepath = Utils.getEffectivePomOutputPath(item.pomXmlFilePath);
let commandMavenProjectEffectivePom = vscode.commands.registerCommand('mavenProject.effectivePom', (item) => {
const pomXmlFilePath = item.fsPath || item.pomXmlFilePath;
const filepath = Utils.getEffectivePomOutputPath(pomXmlFilePath);
let p = new Promise((resolve, reject) => {
exec(`mvn help:effective-pom -f "${item.pomXmlFilePath}" -Doutput="${filepath}"`, (error, stdout, stderr) => {
exec(`mvn help:effective-pom -f "${pomXmlFilePath}" -Doutput="${filepath}"`, (error, stdout, stderr) => {
if (error || stderr) {
console.error(error);
console.error(stderr);