docs/es/skills/quarkus-verification/SKILL.md
Bucle de verificación para proyectos Quarkus: build, análisis estático, pruebas con cobertura, escaneos de seguridad, compilación nativa y revisión de diff antes del lanzamiento o PR.
npx skillsauth add ysyecust/everything-claude-code quarkus-verificationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ejecutar antes de PRs, después de cambios importantes y antes del despliegue.
# Maven
mvn clean verify -DskipTests
# Gradle
./gradlew clean assemble -x test
Si el build falla, detener y corregir errores de compilación.
mvn checkstyle:check pmd:check spotbugs:check
mvn sonar:sonar \
-Dsonar.projectKey=my-quarkus-project \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.login=${SONAR_TOKEN}
# Ejecutar todas las pruebas
mvn clean test
# Generar reporte de cobertura
mvn jacoco:report
# Exigir umbral de cobertura (80%)
mvn jacoco:check
# O con Gradle
./gradlew test jacocoTestReport jacocoTestCoverageVerification
@ExtendWith(MockitoExtension.class)
class UserServiceTest {
@Mock UserRepository userRepository;
@InjectMocks UserService userService;
@Test
void createUser_validInput_returnsUser() {
var dto = new CreateUserDto("Alice", "[email protected]");
doNothing().when(userRepository).persist(any(User.class));
User result = userService.create(dto);
assertThat(result.name).isEqualTo("Alice");
verify(userRepository).persist(any(User.class));
}
}
@QuarkusTest
@QuarkusTestResource(PostgresTestResource.class)
class UserRepositoryIntegrationTest {
@Inject
UserRepository userRepository;
@Test
@Transactional
void findByEmail_existingUser_returnsUser() {
User user = new User();
user.name = "Alice";
user.email = "[email protected]";
userRepository.persist(user);
Optional<User> found = userRepository.findByEmail("[email protected]");
assertThat(found).isPresent();
assertThat(found.get().name).isEqualTo("Alice");
}
}
@QuarkusTest
class UserResourceTest {
@Test
void createUser_validInput_returns201() {
given()
.contentType(ContentType.JSON)
.body("""
{"name": "Alice", "email": "[email protected]"}
""")
.when().post("/api/users")
.then()
.statusCode(201)
.body("name", equalTo("Alice"));
}
@Test
void createUser_invalidEmail_returns400() {
given()
.contentType(ContentType.JSON)
.body("""
{"name": "Alice", "email": "invalid"}
""")
.when().post("/api/users")
.then()
.statusCode(400);
}
}
Verificar target/site/jacoco/index.html para cobertura detallada:
mvn org.owasp:dependency-check-maven:check
Revisar target/dependency-check-report.html para CVEs.
mvn quarkus:audit
mvn quarkus:list-extensions
docker run -t owasp/zap2docker-stable zap-api-scan.py \
-t http://localhost:8080/q/openapi \
-f openapi
Probar compatibilidad de imagen nativa GraalVM:
# Construir ejecutable nativo
mvn package -Dnative
# O con contenedor
mvn package -Dnative -Dquarkus.native.container-build=true
# Probar ejecutable nativo
./target/*-runner
# Ejecutar smoke tests básicos
curl http://localhost:8080/q/health/live
curl http://localhost:8080/q/health/ready
Problemas comunes:
quarkus.native.resources.includesEjemplo de configuración de reflexión:
@RegisterForReflection(targets = {MyDynamicClass.class})
public class ReflectionConfiguration {}
// load-test.js
import http from 'k6/http';
import { check } from 'k6';
export const options = {
stages: [
{ duration: '30s', target: 50 },
{ duration: '1m', target: 100 },
{ duration: '30s', target: 0 },
],
};
export default function () {
const res = http.get('http://localhost:8080/api/markets');
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 200ms': (r) => r.timings.duration < 200,
});
}
k6 run load-test.js
# Liveness
curl http://localhost:8080/q/health/live
# Readiness
curl http://localhost:8080/q/health/ready
# Todos los health checks
curl http://localhost:8080/q/health
# Métricas (si están habilitadas)
curl http://localhost:8080/q/metrics
# Construir imagen de contenedor
mvn package -Dquarkus.container-image.build=true
# Escaneo de seguridad del contenedor
trivy image myorg/my-quarkus-app:1.0.0
grype myorg/my-quarkus-app:1.0.0
mvn quarkus:info
/q/swagger-ui)Generar especificación OpenAPI:
curl http://localhost:8080/q/openapi -o openapi.json
#!/bin/bash
set -e
echo "=== Fase 1: Build ==="
mvn clean verify -DskipTests
echo "=== Fase 2: Análisis Estático ==="
mvn checkstyle:check pmd:check spotbugs:check
echo "=== Fase 3: Pruebas + Cobertura ==="
mvn test jacoco:report jacoco:check
echo "=== Fase 4: Escaneo de Seguridad ==="
mvn org.owasp:dependency-check-maven:check
echo "=== Fase 5: Compilación Nativa ==="
mvn package -Dnative -Dquarkus.native.container-build=true
echo "=== Todas las Fases Completadas ==="
echo "Revisar reportes:"
echo " - Cobertura: target/site/jacoco/index.html"
echo " - Seguridad: target/dependency-check-report.html"
tools
日本語翻訳:このファイルは production-scheduling 用の日本語翻訳が必要です
testing
日本語翻訳:このファイルは production-audit 用の日本語翻訳が必要です
tools
日本語翻訳:このファイルは product-lens 用の日本語翻訳が必要です
tools
日本語翻訳:このファイルは product-capability 用の日本語翻訳が必要です