Skip to content

Commit 5dede3f

Browse files
Developing.md update (membrane#1712)
* DEVELOPING.md update * .
1 parent 5608eb3 commit 5dede3f

1 file changed

Lines changed: 44 additions & 138 deletions

File tree

docs/DEVELOPING.md

Lines changed: 44 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,44 @@
1-
Prequisites
2-
===========
3-
* Java Development Kit (Membrane's source is Java 17 compatible.)
4-
* Maven 3
5-
* IntelliJ or Eclipse (3.7, 4.2, ...) with the m2e plugin
6-
* some git client
7-
8-
Meeting the Requirements
9-
========================
10-
11-
1. To import the Project into your Eclipse, you have to install the Maven plugin for Eclipse(m2e plugin).
12-
13-
2. To install the plugin start Eclipse and select Help->Install New Software.
14-
15-
3. Select http://download.eclipse.org/releases/juno in the Drop down Menu "Work with:".
16-
17-
4. Then search for "maven" within the listed plugins. Fastest option is to use the Filter.
18-
19-
5. Select the m2e plugin named "m2e - Maven Integration for Eclipse" and hit next.
20-
21-
6. Now you'll have to finish this installation by accepting the terms of agreement. Eclipse should be installing the plugin now.
22-
23-
24-
Building in Eclipse
25-
===================
26-
27-
1. Checkout the source code from https://github.com/membrane/service-proxy .
28-
29-
2. Now go to Files->import and select "Existing Maven projects".
30-
31-
3. In the next section you will have to set the service-proxy\cli directory as root-directory. Hit Finish. Eclipse is now building the Workspace, this might take some time. Some build errors will remain until you have completed the next steps.
32-
33-
4. The project service-proxy-annot should be error-free. Right click it and run as "Maven install".
34-
35-
5. Enable annotation processing on service-proxy-core and service-proxy-war: For both projects,
36-
a. Right-click the project.
37-
b. Choose "Properties".
38-
c. Expand "Java Compiler".
39-
d. Select "Annotation Processing".
40-
e. Check both
41-
[X] Enable project specific settings
42-
[X] Enable annotation processing
43-
44-
(Skip to the next section, if you don't need a distribution build.)
45-
46-
6. Right click the service-proxy-core and run as "Maven install".
47-
48-
7. Right click membrane-service-proxy and run as "Maven install".
49-
50-
8. After doing so membrane-service-proxy-x.x.x.zip should be in the \cli\target folder.
51-
52-
53-
Running Service Proxy in Eclipse
54-
================================
55-
56-
1. To run cli, navigate src/main/java/com.predic8.membrane.core/ and run IDEStarter as "Java Application".
57-
58-
Integration Testing
59-
===================
60-
61-
To run the integration tests in an isolated environment, run
62-
63-
docker build .
64-
65-
if you have a Docker Engine available.
66-
67-
68-
Examples Tests
69-
==============
70-
71-
The example tests try to run the membrane.sh/bat scripts in the examples folders of a
72-
distribution build in the target folder. Remember to build after any change otherwise old code
73-
is tested:
74-
75-
Build a distribution in target/ . Then run the example tests.
76-
```sh
77-
mvn clean install -DskipTests
78-
```
79-
80-
81-
## Prequisites
82-
83-
On Mac OS the `setsid` command is needed. It can be installed with:
84-
85-
```sh
86-
brew install util-linux
87-
```
88-
89-
## Running
90-
91-
Run Testclass `ExampleTests`
92-
93-
## Project Site
94-
95-
To build the maven project site, run the `site` goal:
96-
```shell
97-
mvn install #Optionally with -DskipTests
98-
mvn site
99-
```
100-
Besides the maven project site, a set of reports is generated for:
101-
* CVE Vulnerabilities
102-
* Dependency Versions
103-
* Maven Plugin Versions
104-
105-
## Dependency updates
106-
107-
After generating the version reports, Maven can automatically update the POM with the latest dependency versions:
108-
109-
### Apply changes to POM
110-
To apply the latest version information to the POM, make sure to run `mvn site` to generate the reports, then run the following command:
111-
```shell
112-
mvn versions:use-latest-versions #Update all standard versions.
113-
mvn versions:update-properties #Update all versions listed in properties.
114-
```
115-
By default, dependencies are updated to the next latest version available, be it patch, minor or major version.
116-
If the version target should be limited, use any combination of the following properties:
117-
118-
* `-DallowIncrementalUpdates=false`
119-
* `-DallowMinorUpdates=false`
120-
* `-DallowMajorUpdates=false`
121-
122-
For more detailed information visit the [versions-maven-plugin](https://www.mojohaus.org/versions/versions-maven-plugin/examples/advancing-dependency-versions.html) reference.
123-
124-
### Reverting changes to POM
125-
*Note: Do not rely on this mechanism, make sure to utilize an SCM system.*
126-
```shell
127-
mvn versions:revert
128-
```
129-
130-
### Finalizing changes to POM
131-
*Note: This will remove any backup data and permanently accept the new POM information.*
132-
```shell
133-
mvn versions:commit
134-
```
135-
136-
## Troubleshooting
137-
138-
-
1+
# Prerequisites
2+
- Java 21+ (JDK)
3+
- Maven 3
4+
- IntelliJ IDEA (Community or Ultimate)
5+
- Git client
6+
7+
# Setup in IntelliJ
8+
1. Clone the repo: `git clone https://github.com/membrane/api-gateway`
9+
2. Open IntelliJ, go to **File -> Open**, select `api-gateway`, and import as a Maven project.
10+
3. Open **View -> Tool Windows -> Maven**, wait for indexing.
11+
12+
# Build Instructions
13+
1. Run **Maven Install** on `service-proxy-annot` (Right-click -> Run Maven -> Install).
14+
2. Run **Maven Install** on `service-proxy-core` and `membrane-api-gateway` (if distribution build is needed).
15+
- Output: `cli/target/membrane-api-gateway-x.x.x.zip`
16+
17+
# Running the Api Gateway in IntelliJ
18+
1. Create a `proxies.xml` in the `distribution/conf` directory
19+
2. Open `src/main/java/com/predic8/membrane/core/IDEStarter.java`.
20+
3. Right-click -> Run as Java Application.
21+
**Note:** Ensure the working directory is set to /distribution.
22+
23+
# Integration & Example Tests
24+
- If using Docker: `docker build .`
25+
- Run Maven build before tests: `mvn clean package -DskipTests`
26+
- Run **ExampleTests** in IntelliJ.
27+
28+
# Updating Dependencies
29+
1. Run: `mvn site`
30+
2. Update dependencies:
31+
```sh
32+
mvn versions:use-latest-versions
33+
mvn versions:update-properties
34+
```
35+
By default, dependencies are updated to the next latest version available, be it patch, minor or major version.
36+
If the version target should be limited, use any combination of the following properties:
37+
38+
* `-DallowIncrementalUpdates=false`
39+
* `-DallowMinorUpdates=false`
40+
* `-DallowMajorUpdates=false`
41+
42+
For more detailed information visit the [versions-maven-plugin](https://www.mojohaus.org/versions/versions-maven-plugin/examples/advancing-dependency-versions.html) reference.
43+
3. To revert changes: `mvn versions:revert`
44+
4. To finalize changes: `mvn versions:commit`

0 commit comments

Comments
 (0)