| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A comprehensive Java development environment using layered Docker containers.
./scripts/build-layer.shThis will:
./setup.shcode .Then select "Reopen in Container" from the command palette.
Benefits:
# Create new Maven project
mvn archetype:generate -DgroupId=com.example -DartifactId=my-app
# Build and package
mvn-package # alias for: mvn clean package
# Run tests
mvn-test# Create new Gradle project
gradle init
# Build project
gradle-build # alias for: gradle build
# Run tests
gradle-testStore SONARQUBE_TOKEN outside .codex, for example in ~/.config/sonarqube/sonar.env. The Java helpers read the same file used by the Codex MCP setup and export SONAR_TOKEN for scanner tools.
For Maven projects, run from the project root:
sonarcloud-java-mavenThis runs JaCoCo prepare-agent, verify, JaCoCo report, and the Sonar Maven scanner. The default JaCoCo XML path is target/site/jacoco/jacoco.xml, which SonarCloud detects automatically.
For Gradle projects, the project must apply both plugins:
plugins {
id "jacoco"
id "org.sonarqube" version "7.3.1.8318"
}
jacocoTestReport {
reports {
xml.required = true
}
}Then run:
sonarcloud-java-gradleThis runs test, jacocoTestReport, and ${SONAR_GRADLE_TASK:-sonar} using ./gradlew when it exists, otherwise the system gradle. Set SONAR_GRADLE_TASK=sonarqube for projects that still expose the older task name.
# Create new Spring Boot project
spring init --dependencies=web,data-jpa my-spring-app
# Run Spring Boot application
spring-run # alias for: ./mvnw spring-boot:run# List available Java versions
sdk list java
# Install a specific Java version
sdk install java 17.0.9-tem
# Switch Java version
sdk use java 17.0.9-tem/workspace/ ├── projects/ # Your Java projects ├── m2repo/ # Maven repository cache └── .gradle/ # Gradle cache
Maven is configured to use /workspace/m2repo for the local repository, persisting dependencies across container restarts.
# Check if image exists
docker images | grep java-bench
# Rebuild Layer 2 and Layer 3 if needed
./scripts/build-layer.sh# Check Maven settings
cat ~/.m2/settings.xml
# Clear cache if needed
rm -rf /workspace/m2repo/*# Verify Java version
java -version
# Check JAVA_HOME
echo $JAVA_HOME| Back | FazBrowse Home | New Git URL |