-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
47 lines (42 loc) · 1.94 KB
/
build.ps1
File metadata and controls
47 lines (42 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
buildWrite-Host "Minecraft FluxCraft - Building with Docker" -ForegroundColor Cyan
Write-Host "=============================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Building plugin using Docker Maven..." -ForegroundColor Yellow
# Build using Docker Maven
docker run --rm -v "${PWD}:/usr/src/app" -w /usr/src/app maven:3.9.11-eclipse-temurin-21 mvn clean package
if ($LASTEXITCODE -ne 0) {
Write-Host ""
Write-Host "Error: Failed to build plugin" -ForegroundColor Red
Write-Host ""
Write-Host "Alternative: Install Java 21 and Maven locally" -ForegroundColor Yellow
Write-Host "1. Download Java 21 from: https://adoptium.net/" -ForegroundColor White
Write-Host "2. Download Maven from: https://maven.apache.org/download.cgi" -ForegroundColor White
Write-Host ""
Read-Host "Press Enter to continue"
exit 1
}
Write-Host ""
Write-Host "=============================================" -ForegroundColor Cyan
Write-Host "Plugin built successfully!" -ForegroundColor Green
Write-Host ""
Write-Host "The JAR file is now in: target/fluxcraft-<version>.jar" -ForegroundColor White
Write-Host ""
Write-Host "Copying plugin to plugins folder..." -ForegroundColor Yellow
Copy-Item target\fluxcraft-*.jar plugins\ -Force
if ($LASTEXITCODE -eq 0) {
Write-Host "✅ Plugin copied successfully to plugins folder!" -ForegroundColor Green
} else {
Write-Host "❌ Failed to copy plugin to plugins folder" -ForegroundColor Red
Read-Host "Press Enter to continue"
exit 1
}
Write-Host ""
Write-Host "=============================================" -ForegroundColor Cyan
Write-Host "Build and copy completed!" -ForegroundColor Green
Write-Host ""
Write-Host "Restarting Minecraft server to load the new plugin..." -ForegroundColor Yellow
docker compose restart paper-server
Write-Host ""
Write-Host "✅ Server restarted! The new plugin is now active." -ForegroundColor Green
Write-Host ""
Read-Host "Press Enter to continue"