From 8bc598fb9d2c34554443879f8d954aed481d5e6b Mon Sep 17 00:00:00 2001 From: Victor Rubezhny Date: Mon, 17 Jul 2023 13:43:22 +0200 Subject: [PATCH] Create downloadable lemminx-maven uber JAR #434 A set of lemminx-maven jar and the required dependency jars can be exported to `./lemminx-maven/target/vscode-lemminx-maven-jars/` directory by executing the following build command: ```bash $ ./mvnw verify -DskipTests -Pgenerate-vscode-jars ``` To demonstrate LemMinX-Maven functionality: 1. Copy the resulting `vscode-lemminx-maven-jars/` to `vscode-xml` extension project root directory 2. Modify `vscode-xml/package.json` adding the following configuration to the `contributes` section: ```json "xml.javaExtensions": [ "./vscode-lemminx-maven-jars/*.jar" ], ``` 6. Restart vscode-xml extension and try editing a Maven project file (Maven project validation, content assist for group ID, artifact ID and versions, hovers for artifacts and Maven properties, Maven properties refactoring etc.) Issue: #430 --- CONTRIBUTING.md | 69 +++++++++++++++++++++++++++++++++++++++++++ lemminx-maven/pom.xml | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..0729ae9e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,69 @@ +# How to Contribute + +Contributions are essential for keeping this language server extension great. We try to keep it as easy as possible to contribute changes and we are open to suggestions for making it even easier. There are only a few guidelines that we need contributors to follow. + +## Development + +### Installation Prerequisites: + + * [JDK 17+](https://adoptopenjdk.net/) + * [Maven 3.9.3+](https://maven.apache.org/) + +### Lemmix Language Server + +LemMinX-Maven is an extension to Lemminx Language Server, so you may need to clone and build Lemminx before start contributing to LemMinX-Maven. See [Lemminx Contribution](https://raw.githubusercontent.com/eclipse/lemminx/main/CONTRIBUTING.md) Guide on how to get and build Lemminx Language Server + +### Steps + +1. Fork and clone the LemMinX-Maven repository: + +``` +git clone https://github.com/eclipse/lemminx-maven.git +``` + +2. Build/Test LemMinX-Maven on Mac/Linux: + ```bash + $ ./mvnw verify + ``` + or for Windows: + ```bash + $ mvnw.cmd verify + ``` + +### Debug + +The LemMinX-Maven extension must be debugged remotely as it's most useful when connected to a client. In order to debug, one needs to look at whether the specific language client provides such a capability. For example : + +* [M2E Maven POM File Editor (Wild Web Developer, LemMinX, LS)](https://github.com/eclipse-m2e/m2e-core/tree/master) - See : [How to... develop and debug m2e and lemminx-maven integration](https://github.com/eclipse-m2e/m2e-core/blob/master/org.eclipse.m2e.editor.lemminx/HOWTO-DEV.md) + +#### Building and running LemMinX-Maven in [VSCode-XML](https://github.com/redhat-developer/vscode-xml/blob/main/README.md#contributing) extension. + +1. Build LemMinX-Maven set of dependency and extension Jars for VSCode-XML extension: + + ```bash + $ ./mvnw verify -DskipTests -Pgenerate-vscode-jars + ``` + or for Windows: + ```bash + $ mvnw.cmd verify -DskipTests -Pgenerate-vscode-jars + ``` + +2. Clone and build VSCode-XML extension, See: [VSCode-XML Extension Contribution Guide](https://github.com/redhat-developer/vscode-xml/blob/main/CONTRIBUTING.md#steps) + +3. Try running the VSCode-XML extension to make sure everything is correctly installed and XML editor works (validation, content assist, hovers, etc. for XML tags and attributes) + +4. Copy `/lemminx-maven/target/vscode-lemminx-maven-jars` directory to VSCode-XML extension project directory and make sure it's visible in `vscode-xml`project in VSCode + +5. In VSCode modify `vscode-xml/package.json` adding the following configuration to the `contributes` section: + +```json + "xml.javaExtensions": [ + "./vscode-lemminx-maven-jars/*.jar" + ], +``` + +6. Restart VSCode-XML extension and try editing a Maven project file (Maven project validation, content assist for group ID, artifact ID and versions, hovers for artifacts and Maven properties, Maven properties refactoring etc.) + +### Pull Requests + +In order to submit contributions for review, please make sure you have signed the [Eclipse Contributor Agreement](https://www.eclipse.org/legal/ecafaq.php) (ECA) with your account. diff --git a/lemminx-maven/pom.xml b/lemminx-maven/pom.xml index 86f7f6a9..8a923a7c 100644 --- a/lemminx-maven/pom.xml +++ b/lemminx-maven/pom.xml @@ -212,6 +212,59 @@ + + + generate-vscode-jars + + false + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.0 + + + copy-vscode-jar-dependencies + package + + copy-dependencies + + + + copy-lemminx-maven-to-vscode-jars + package + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + jar + true + + + + + copy + + + + + + + ${project.build.directory}/vscode-lemminx-maven-jars + true + true + true + + + + + + + lemminx-releases