forked from tsn-coding-dojo/java-spring-formation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-all-projects.ps1
29 lines (24 loc) · 1.08 KB
/
build-all-projects.ps1
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
# Specify the parent directory where your Maven projects are located
$parentDirectory = Get-Location
# Get a list of subdirectories in the parent directory
$projectDirectories = Get-ChildItem -Path $parentDirectory -Directory
$excludedDirectory = "todo-project-TypeScriptGenerator"
foreach ($projectDirectory in $projectDirectories) {
# Check if the directory is the excluded directory
if ($projectDirectory.Name -eq $excludedDirectory) {
Write-Host "Skipping excluded directory: $($projectDirectory.FullName)"
continue
}
# Check if the directory contains a pom.xml file
$pomFile = Join-Path $projectDirectory.FullName "pom.xml"
if (Test-Path $pomFile) {
Write-Host "Building Maven project in: $($projectDirectory.FullName)"
# Change to the project directory and perform Maven build
Set-Location -Path $projectDirectory.FullName
mvn clean verify
# Return to the original directory
Set-Location -Path $parentDirectory
} else {
Write-Host "No Maven project found in: $($projectDirectory.FullName)"
}
}