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

How to download lemminx-maven uber JAR? #430

Closed
angelozerr opened this issue Jun 29, 2023 · 12 comments · Fixed by #434
Closed

How to download lemminx-maven uber JAR? #430

angelozerr opened this issue Jun 29, 2023 · 12 comments · Fixed by #434
Assignees

Comments

@angelozerr
Copy link

angelozerr commented Jun 29, 2023

I wonder if it is possible to download the lemminx-maven uber JAR? It would be nice to provide this capability in order vscode users can play with it quickly :

"xml.extension.jars": [
  "/absolute/path/to/downloaded/lemminx-maven-uber.jar"
],
  • close and restart the vscode.
@mickaelistria
Copy link
Contributor

So far, we do not produce such uber-jar. What it contains depends on the target (eg should it include LemMinX and/or should it include Maven APIs and/or only its dependencis that are not provided by X or Y...). So since there is no clear definition of what it should contain in general, it looks like it's an integration-specific issue and it should be up to clients to build the artifact they need.

@angelozerr
Copy link
Author

It should be really nice to provide this uber JAR to help vscode users to test your lemminx maven extension and promote lemminx-maven. Our final goal is to integrate lemminx-maven in vscode-maven (see issue at microsoft/vscode-maven#47) but for now uber JAR could be very helpfull to give the capability to vscode users to play with lemminx maven (and have vscode users feedback and not only Eclipse IDE feedback).

//cc @fbricon @rgrunber

This uber jar should store lemminx-maven, maven dependencies without lsp4j and lemminx dependencies.

vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 5, 2023
@vrubezhny
Copy link
Contributor

@angelozerr I've tried to create a lemminx-maven-uber.jar - see #434 - currently it contains almost every lemminx-maven and dependency classes with the following exclusions:

  • org.eclipse.lemminx:org.eclipse.lemminx:*
  • org.eclipse.lsp4j:*:*

The jar is created in lemminx-maven/target directory.

But it still needs to be tested if all the non-welcomed dependencies are excluded (so they do not duplicate the ones provided by lemminx itself).

@vrubezhny vrubezhny linked a pull request Jul 5, 2023 that will close this issue
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 6, 2023
@vrubezhny vrubezhny self-assigned this Jul 7, 2023
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 7, 2023
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 7, 2023
@vrubezhny
Copy link
Contributor

vrubezhny commented Jul 7, 2023

I could contribute the extension only by adding

 "contributes": {
   "xml.javaExtensions": [
     "./jars/lemminx-maven-vscode-uber.jar"
   ],

to vscode-xml/packaje.json.

Adding the lines like

"xml.extension.jars": [
  "/absolute/path/to/downloaded/lemminx-maven-uber.jar"
],

to vscode-xml/.vscode/settings.json didn't work for me.

Unfortunately, the extension (lemminx-maven-vscode-uber.jar) itself doesn't work at the moment due to the missing dependency problems - see the comments and build logs in #434

vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 10, 2023
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 10, 2023
@mickaelistria
Copy link
Contributor

As mentioned in a direct discussion, I think the uber-jar may not be the best fit for VSCode extension. Having a maven module requiring lemminx-maven and filtering its dependencies and using copy-dependencies and passing the list of jars to vscode-xml may provide easier and better result.

vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 12, 2023
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 17, 2023
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: eclipse#430
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 17, 2023
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: eclipse#430
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 18, 2023
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: eclipse#430
@vrubezhny
Copy link
Contributor

It looks like a single Uber jar cannot be created for Lemminx-Maven. The proposed solution creates a directory that contains the Lemminx-Maven jar as well as all the required dependency jars that can be copied to vscode-xml project and vscode-xml extension can be configured to use those jars in vscode-xml/package.json file.

The instructions on how to build and run Lemminx-Maven in vscode-xml are written down to https://github.com/eclipse/lemminx-maven/blob/master/CONTRIBUTING.md#building-and-running-lemminx-maven-in-vscode-xml-extension

@angelozerr Is that enough for this issue?

@angelozerr
Copy link
Author

Thanks so much for having worked on this issue. I will try it ASAP.

I wonder if we could provide a github action which will provide a zip of thi vscode uber JAR?

@vrubezhny
Copy link
Contributor

@angelozerr Do you plan to use such a zip directly in vscode-xml or to simplify downloading (for a maven build, f.i.)?

Just asking because I tried to pack the generated jars into a Zip and and use it in vscode-xml/package.json instead of *.jar, like:

  "xml.javaExtensions": [
     "./vscode-lemminx-maven-jars/vscode-lemminx-maven-uber.zip"
   ],

... but it didn't worked for me. So it needs to be unpacked...

@angelozerr
Copy link
Author

For the moment I have no plan, but I think if vscode users want to test lemminx-maven in vscode I think it should be better to have an easier process instead of building lemminx-maven himself.

It is just me feeling, but I think it is not the priority for now

@vrubezhny
Copy link
Contributor

Then I can try making it the same way as we produce lemminx-maven-zip-with-dependencies.zip which is to be pushed to the repositories so it could be available for downloading.

vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 18, 2023
This PR also makes the build,  when executed with  `-Pgenerate-vscode-jars ` argument,
to pack the contents of `vscode-lemminx-maven-jars` directory to
`lemminx-maven-<version>-vscode-uber-jars.zip` and upload this archive
to the releass/snapshots repositories.

Issue: eclipse#430
vrubezhny added a commit that referenced this issue Jul 18, 2023
This PR also makes the build,  when executed with  `-Pgenerate-vscode-jars ` argument,
to pack the contents of `vscode-lemminx-maven-jars` directory to
`lemminx-maven-<version>-vscode-uber-jars.zip` and upload this archive
to the releass/snapshots repositories.

Issue: #430
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Jul 18, 2023
vrubezhny added a commit that referenced this issue Jul 18, 2023
@vrubezhny
Copy link
Contributor

vrubezhny commented Jul 18, 2023

@angelozerr The Lemminx-Maven snapshots repository now is added with the following Zip:

lemminx-maven-0.9.1-20230718.222800-12-vscode-uber-jars.zip Tue Jul 18 22:28:06 GMT 2023 20114153  
lemminx-maven-0.9.1-20230718.222800-12-vscode-uber-jars.zip.md5 Tue Jul 18 22:28:06 GMT 2023 32  
lemminx-maven-0.9.1-20230718.222800-12-vscode-uber-jars.zip.sha1 Tue Jul 18 22:28:06 GMT 2023 40  

So it can be downloaded and used to run with VSCode XML.
The releases repository will be updated with the Lemminx-Maven VSCode Uber Jars archive once v.0.9.1 is released.

@angelozerr
Copy link
Author

Thanks so much @vrubezhny !

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

Successfully merging a pull request may close this issue.

3 participants