https://github.com/avojak/p2-inspector
A headless Eclipse plugin which exposes a REST interface for inspecting and retrieving the contents of a remote p2 repository.
https://github.com/avojak/p2-inspector
eclipse-plugin java jetty p2
Last synced: 3 months ago
JSON representation
A headless Eclipse plugin which exposes a REST interface for inspecting and retrieving the contents of a remote p2 repository.
- Host: GitHub
- URL: https://github.com/avojak/p2-inspector
- Owner: avojak
- License: epl-1.0
- Created: 2019-02-15T20:49:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T03:54:57.000Z (about 6 years ago)
- Last Synced: 2025-03-29T12:05:03.115Z (3 months ago)
- Topics: eclipse-plugin, java, jetty, p2
- Language: Java
- Homepage:
- Size: 120 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# P2 Inspector
[](https://travis-ci.org/avojak/p2-inspector) [](https://coveralls.io/github/avojak/p2-inspector?branch=master) [](https://opensource.org/licenses/EPL-1.0)  
P2 Inspector is a headless Eclipse plugin which exposes a REST interface for inspecting and retrieving the contents of a remote P2 repository.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
### Prerequisites
Java 1.8+
### Installing
```
$ cd com.avojak.webapp.p2.inspector.releng
$ mvn clean package
```Artifacts are build in:
```
com.avojak.webapp.p2.inspector.packaging/target/products/com.avojak.webapp.p2.inspector.product/
```### Docker
After installing, you can build the Docker image:
```
$ cd ..
$ docker build --tag avojak/p2-inspector:latest .
```## Usage
Different executables are provided for various platforms (Windows, macOS, Linux).
### Linux Example
```
$ cd com.avojak.webapp.p2.inspector.packaging/target/products/
$ cd com.avojak.webapp.p2.inspector.product/linux/gtk/x86_64/
$ ./p2-inspector
```### Docker
```
$ docker run --rm -p 8081:8081 avojak/p2-inspector:latest
```To make a request to the REST service, make a `GET` request to the `/repository` endpoint with a `url` parameter for the desired p2 repository.
For example:
```
$ curl http://localhost:8081/repository?url=http://example.com
```The response will be a JSON object built from the `P2Repository` model.
P2Repository model:
* name: `String`
* location: `String`
* isCompressed: `Boolean`
* lastModified: `Long`
* groups: `IUGroup[]`IUGroup model:
* name: `String`
* id: `String`
* description: `String`
* copyright: `String`
* licenses: `License[]`
* version: `String`License model:
* name: `String`
* body: `String`
* location: `String`## Deployment
The recommended method of deployment is via the Docker image, although any of the platform-specific products may also be used.
## Build System Configuration
Use of a CI/CD platform requires the following environment variables be set:
* `DOCKERHUB_USERNAME`
* `DOCKERHUB_PASSWORD`
* `HEROKU_USERNAME`
* `HEROKU_PASSWORD`
* `SONATYPE_USERNAME`
* `SONATYPE_PASSWORD`
* `HEROKU_API_KEY`## PDE Target Definition
Under the Oxygen site:
* Eclipse Project SDK
* Equinox Target ComponentsUnder the Orbit site:
* Byte Buddy Java agent
** Optionally add the source bundle
* Gson: Google Json Library for Java
** Optionally add the source bundle
* Guava: Google Core Libraries for Java
** Optionally add the source bundle
* Hamcrest Library of Matchers
* JAXP XML
* mockito-core
** Optionally add the source bundle
* SLF4J Simple Binding
** Optionally add the source bundleThe resulting source should look like this:
```xml
```
## Built With
* [Tycho](https://www.eclipse.org/tycho/) - Building the Eclipse plugin
* [Maven](https://maven.apache.org/) - Dependency management
* [Jetty](https://www.eclipse.org/jetty/) - Embedded web server## Versioning
I use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/avojak/p2-inspector/tags).
## License
This project is licensed under the Eclipse Public License v1.0 - see the [LICENSE.md](LICENSE.md) file for details.
## Acknowledgments
* The structure of this project, and the ability to create a cross-platform, headless Eclipse plugin, was directly inspired by [irbull/p2diff](https://github.com/irbull/p2diff)