Official build system for NIT Patna's backend services - A powerful Maven-based build automation tool with cross-platform support
npm install nitp-build-toolsbash
npm install -g @nitp/build-tools
`
$3
`bash
npm install --save-dev @nitp/build-tools
`
$3
`bash
nitp-build --version
nitp-build doctor # Check system health
`
๐ Quick Start
`bash
Show all available commands
nitp-build --help
Check system requirements
nitp-build doctor
Show system information
nitp-build info
Build the project
nitp-build build
Run tests with coverage
nitp-build test
Start development server
nitp-build start:admin --env=dev
`
๐ Requirements
$3
- Node.js: >= 14.0.0
- npm: >= 6.0.0
- Java: >= 17 (OpenJDK or Oracle JDK)
- Maven: >= 3.8.0
- Git: Latest version
$3
| Platform | Status | Notes |
|----------|--------|-------|
| Windows | โ
Full Support | Tested on Windows 10/11 |
| macOS | โ
Full Support | Tested on macOS 11+ |
| Linux | โ
Full Support | Tested on Ubuntu, CentOS, Debian |
๐ง Commands
$3
`bash
Full build with tests and quality checks
nitp-build build
Quick build without tests (for development)
nitp-build build:fast
Build with specific environment
nitp-build build --env=prod --verbose
`
$3
`bash
Run all tests with coverage
nitp-build test
Run only unit tests
nitp-build test:unit
Run only integration tests
nitp-build test:integration
Test specific module
nitp-build test --module=admin
`
$3
`bash
Run all quality checks
nitp-build quality
Format code using Spotless
nitp-build format
Quality check with verbose output
nitp-build quality --verbose
`
$3
`bash
Start Admin API server
nitp-build start:admin
Start TNP API server
nitp-build start:tnp
Start with specific environment
nitp-build start:admin --env=test
`
$3
`bash
Start all services with Docker
nitp-build docker:up
`
$3
`bash
Show system information
nitp-build info
Check system health
nitp-build doctor
Show help
nitp-build --help
`
โ๏ธ Configuration
The build system uses a comprehensive configuration file (lib/nitp-build-v2.json) that defines:
- Scripts: Available build commands and their Maven configurations
- Modules: Project structure and dependencies
- Environments: Environment-specific settings and properties
- Coverage: Code coverage thresholds and reporting
- Quality: Code quality tools and standards
$3
| Module | Type | Description | Coverage Threshold |
|--------|------|-------------|-------------------|
| nitp-core | Library | Core shared functionality | 80% lines, 70% branches |
| nitp-admin-api | Application | Administrative API | 75% lines, 65% branches |
| nitp-tnp-api | Application | Training & Placement API | 75% lines, 65% branches |
๐ Environments
$3
- Profile: spring.profiles.active=dev
- Database: MySQL localhost
- Logging: DEBUG level
- JVM: -Xmx512m
`bash
nitp-build build --env=dev
`
$3
- Profile: spring.profiles.active=test
- Database: H2 in-memory
- Logging: INFO level
- JVM: -Xmx256m
`bash
nitp-build test --env=test
`
$3
- Profile: spring.profiles.active=prod
- Database: Production MySQL
- Logging: WARN level
- JVM: -Xmx1024m -XX:+UseG1GC
`bash
nitp-build build --env=prod
`
๐ Code Coverage
Coverage reports are automatically generated using JaCoCo:
$3
- HTML Report: target/site/jacoco/index.html
- XML Report: target/site/jacoco/jacoco.xml
- CSV Report: target/site/jacoco/jacoco.csv
$3
- Core Module: 80% line coverage, 70% branch coverage
- API Modules: 75% line coverage, 65% branch coverage
$3
`bash
Run tests to generate coverage
nitp-build test
Open HTML report (Windows)
start target/site/jacoco/index.html
Open HTML report (macOS)
open target/site/jacoco/index.html
Open HTML report (Linux)
xdg-open target/site/jacoco/index.html
`
๐ Quality Standards
$3
- Tool: Spotless
- Standards: Google Java Style Guide
- Command: nitp-build format
$3
- CheckStyle: Java coding standards
- PMD: Programming mistake detector
- SpotBugs: Bug pattern detection
$3
- Framework: JUnit 5
- Parallel Execution: Enabled
- Failure Reruns: Enabled for stability
๐ Troubleshooting
$3
#### Command Not Found
`bash
Check if npm global bin is in PATH
npm config get prefix
Manually add to PATH (Linux/macOS)
export PATH="$(npm config get prefix)/bin:$PATH"
Manually add to PATH (Windows)
set PATH=%PATH%;%APPDATA%\npm
`
#### Permission Denied (Unix Systems)
`bash
Fix npm permissions
sudo npm install -g @nitp/build-tools
Or use npx
npx @nitp/build-tools build
`
#### Java/Maven Not Found
`bash
Check Java installation
java -version
Check Maven installation
mvn -v
Install Java (Ubuntu/Debian)
sudo apt update
sudo apt install openjdk-17-jdk
Install Maven (Ubuntu/Debian)
sudo apt install maven
`
#### Build Failures
`bash
Check system requirements
nitp-build doctor
Run with verbose output
nitp-build build --verbose
Clean and rebuild
mvn clean
nitp-build build
`
$3
1. Check Documentation: Read this README thoroughly
2. Run Diagnostics: Use nitp-build doctor to check system health
3. Verbose Output: Add --verbose flag to any command for detailed logs
4. Check Issues: Visit GitHub Issues
5. Contact Developer: Reach out via LinkedIn
๐ค Contributing
We welcome contributions to improve the NITP Build System!
$3
`bash
Clone the repository
git clone https://github.com/ashishkr375/adminportal_updated_new.git
Navigate to build tools
cd adminportal_updated_new/backend/nitp-build-tools
Install dependencies
npm install
Link for local development
npm link
`
$3
1. Fork the repository
2. Create a feature branch (git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add amazing feature')
4. Push to the branch (git push origin feature/amazing-feature`)