Skip to content

Commit

Permalink
IGNITE-17487 Removed maven project. Fixes apache#1421
Browse files Browse the repository at this point in the history
Signed-off-by: Slava Koptilin <[email protected]>
  • Loading branch information
Pochatkin authored and sk0x50 committed Jan 12, 2023
1 parent 4a1baf4 commit 44efe1e
Show file tree
Hide file tree
Showing 72 changed files with 30 additions and 9,388 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
target
work
.DS_Store
.flattened-pom.xml
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ Inspection profile is placed to IDEA [Project_Default](idea/ignite_inspections.x
* Configure [IDEA Codestyle](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines#CodingGuidelines-A.ConfigureIntelliJIDEAcodestyle).

### Building project
Usually all Maven builds are to be run with skipped tests:
Compile project via Gradle
```
mvn -DskipTests <goal>
./gradlew assemble
```
See also [DEVNOTES.md](DEVNOTES.md)
204 changes: 10 additions & 194 deletions DEVNOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,204 +8,20 @@
* [Release candidate verification](#release-candidate-verification)
***

# Deprecated Maven build

The maven is depricated and will be removed soon. Gradle is a primary build tool, please follow instructions for that.

## Prerequisites
* Java 11 SDK
* Maven 3.6.0+ (for building)
***


## Building Ignite
Ignite follows standard guidelines for multi-module maven projects, so it can be easily built using the following command from the project root directory (you can disable the tests when building using `-DskipTests`):
Ignite follows standard guidelines for multi-module Gradle projects, so it can be easily built using the following command from the project root directory (you can disable the tests when building using `-x test`):
```
mvn clean package [-DskipTests]
gradlew clean build
```
Upon build completion, CLI tool can be found be under `modules/cli/target` directory. Use `ignite` on Linux and MacOS, or `ignite.exe` on Windows.
Upon build completion, CLI tool can be found be under `modules/cli/build` directory. Use `ignite` on Linux and MacOS, or `ignite.exe` on Windows.
***


## Running sanity checks
### Code style
Code style is checked with [Apache Maven Checkstyle Plugin](https://maven.apache.org/plugins/maven-checkstyle-plugin/).
* [Checkstyle rules](check-rules/checkstyle-rules.xml)
* [Checkstyle suppressions](check-rules/checkstyle-suppressions.xml)
* [Checkstyle rules for javadocs](https://checkstyle.sourceforge.io/config_javadoc.html)

It is enabled by default and is bound to `compile` phase.

Build project without code style check:
```
mvn clean <compile|package|install|deploy> -Dcheckstyle.skip
```

Run code style checks only:
```
mvn clean validate -Pcheckstyle -Dmaven.all-checks.skip
```

Run javadoc style checks for public api only:
```
mvn clean checkstyle:checkstyle-aggregate -P javadoc-public-api
```
>`javadoc-public-api` profile is required for enabling checkstyle rules for public API javadoc.
Code style check results are generated at:
* `target/site/checkstyle-aggregate.html`
* `target/checkstyle.xml`

### Legacy API
The project is checked for legacy APIs with [Modernizer Maven Plugin](https://github.com/gaul/modernizer-maven-plugin/).
* [Modernizer rules](check-rules/modernizer-rules.xml)

Plugin is enabled by default and is bound to `test-compile` phase (due to requirement to run on already compiled classes)

Build project without legacy API check:
```
mvn clean <compile|package|install|deploy> -Dmodernizer.skip
```

Run legacy API checks only:
```
mvn clean test-compile -Pmodernizer -Dmaven.all-checks.skip
```
or
```
mvn clean test-compile -Dmaven.all-checks.skip && mvn modernizer:modernizer
```

### License headers
Project files license headers match with required template is checked with [Apache Rat Maven Plugin](https://creadur.apache.org/rat/apache-rat-plugin/).
```
mvn clean apache-rat:check -pl :apache-ignite
```
License headers check result is generated at `target/rat.txt`

### PMD
Static code analyzer is run with [Apache Maven PMD Plugin](https://maven.apache.org/plugins/maven-pmd-plugin/). Precompilation is required 'cause PMD shoud be run on compiled code.
* [PMD rules](check-rules/pmd-rules.xml)
```
mvn clean compile pmd:check
```
PMD check result (only if there are any violations) is generated at `target/pmd.xml`.
***

### Maven
Project is supplied with number of custom scripts for Maven sanity check.
To run checks, execute:
```
bash check-rules/maven-check-scripts/run.sh
```
from root of the project.

Linux, MacOS, WSL (Windows Subsystem on Linux) or alike environment is required.
`xpath` should be present in PATH
***


## Running tests
Run unit tests only:
```
mvn test
```
Run unit + integration tests:
```
mvn integration-test
```
Run integration tests only:
```
mvn integration-test -Dskip.surefire.tests
```
***


## Checking and generating Javadoc
Javadoc is generated and checked for correctness with [Maven Javadoc Plugin](https://maven.apache.org/plugins/maven-javadoc-plugin/).
(Javadoc style check is described above in [Code style](#code-style) section)

Check Javadoc is correct (precompilation is required for resolving internal dependencies):
```
mvn compile javadoc:javadoc
```
Build Javadoc jars (found in `target` directory of module):
```
mvn package -P javadoc -Dmaven.test.skip
```
Build Javadoc site (found in `target/site/apidocs/index.html`):
```
mvn compile javadoc:aggregate -P javadoc
```
>`javadoc` profile is required for excluding internal classes
***


## Setting up IntelliJ Idea project
You can quickly import Ignite project to your IDE using the root `pom.xml` file. In IntelliJ, choose `Open Project` from the `Quick Start` box or choose `Open...` from the `File` menu and select the root `pom.xml` file.

After opening the project in IntelliJ, double check that the Java SDK is properly configured for the project:
* Open the `File` menu and select `Project Structure...`
* In the SDKs section, ensure that a 1.11 JDK is selected (create one if none exist)
* In the `Project` section, make sure the project language level is set to 11.0 as Ignite makes use of several Java 11
language features

Ignite uses machine code generation for some of it's modules. To generate necessary production code, build the project using maven (see [Building Ignite](#building-ignite)).

If you want to make use of Idea build action and incremental compilation, you have to alter the build process manually
as Idea Maven integration doesn't support all the Maven plugins out of the box.
* Open Maven tab
* Click on the gear and untick `Show Basic Phases Only`
* Find `ignite-sql-engine` module
* Select `Lifecycle` -> `process-resources`
* Open contextual menu and select `Before Build`

***


## Code structure
High-level modules structure and detailed modules description can be found in the [modules readme](modules/README.md).
***


## Release candidate verification
1. Build the package (this will also run unit tests and the license headers check)
```
mvn clean package
```
1. Go to the `modules/cli/target` directory which now contains the packaged CLI tool
```
cd modules/cli/target
```
1. Run the tool without parameters (full list of available commands should appear)
```
./ignite
```
1. Run the initialization step
```
./ignite init --repo=<path to Maven staging repository>
```
1. Install an additional dependency (Guava is used as an example)
```
./ignite module add mvn:com.google.guava:guava:23.0
```
1. Verify that Guava has been installed
```
./ignite module list
```
1. Start a node
```
./ignite node start myFirstNode
```
1. Check that the new node is up and running
```
./ignite node list
```
1. Stop the node
```
./ignite node stop myFirstNode
```
# Gradle build

## Prerequisites
Expand All @@ -214,7 +30,7 @@ High-level modules structure and detailed modules description can be found in th


## Building Ignite
Ignite follows standard guidelines for multi-module gradle projects, so it can be easily built using the following command from the project
Ignite follows standard guidelines for multi-module Gradle projects, so it can be easily built using the following command from the project
root directory (you can disable the tests when building using `-x test`):
```shell
./gradlew clean build -x test
Expand Down Expand Up @@ -275,7 +91,7 @@ Run legacy API checks only:
Static code analyzer is run with [Apache Gradle PMD Plugin](https://docs.gradle.org/current/userguide/pmd_plugin.html).
* [PMD rules](check-rules/pmd-rules.xml)
```shell
./gradlew clean pmdMain pmdTest pmdTestFixtures pmdIntegrationTest
./gradlew clean pmdMain
```
PMD check result (only if there are any violations) is generated at `<module-name>/build/reports/pmd/`.
***
Expand Down Expand Up @@ -451,27 +267,27 @@ docker run -it --rm --net ignite3_default apacheignite/ignite3 cli
```shell
./gradlew clean docker distZip allDistZip buildRpm buildDeb
```
1. Go to the `packaging/build/distributions` directory which now contains the packaged CLI tool and Ignite
2. Go to the `packaging/build/distributions` directory which now contains the packaged CLI tool and Ignite
```shell
cd packaging/build/distributions
unzip ignite3-<version>
```
1. Run the tool without parameters (full list of available commands should appear)
3. Run the tool without parameters (full list of available commands should appear)
```shell
cd ignite3-cli-<version>
./bin/ignite3
```
1. Start a node
4. Start a node
```shell
cd ../ignite3-db-<version>
./bin/ignite3db start
```
1. Check that the new node is up and running
5. Check that the new node is up and running
```shell
cd ../ignite3-cli-<version>
./bin/ignite3 node status
```
1. Stop the node
6. Stop the node
```shell
cd ../ignite3-db-<version>
./bin/ignite3db stop
Expand Down
4 changes: 2 additions & 2 deletions assembly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ creation to specify a custom logger for logs generated by the client.

## Running Examples

Examples are shipped as a separate Maven project, which is located in the `examples` folder.
To start running you simply need to import provided `pom.xml` file into your favourite IDE.
Examples are shipped as a separate Gradle project, which is located in the `examples` folder.
To start running you simply need to import provided `build.gradle` file into your favourite IDE.

The following examples are included:
* `RecordViewExample` - demonstrates the usage of the `org.apache.ignite.table.RecordView` API
Expand Down
78 changes: 0 additions & 78 deletions assembly/assembly.xml

This file was deleted.

This file was deleted.

Loading

0 comments on commit 44efe1e

Please sign in to comment.