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

Create downloadable lemminx-maven uber JAR #434

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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>/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.
53 changes: 53 additions & 0 deletions lemminx-maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,59 @@
</plugins>
</build>

<profiles>
<profile>
<id>generate-vscode-jars</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>copy-vscode-jar-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
<execution>
<id>copy-lemminx-maven-to-vscode-jars</id>
<phase>package</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
</configuration>
<goals>
<goal>copy</goal>
</goals>

</execution>
</executions>
<configuration>
<outputDirectory>
${project.build.directory}/vscode-lemminx-maven-jars</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<repositories>
<repository>
<id>lemminx-releases</id>
Expand Down