Create 3 simple cross-platform run configurations
1. Pet Shop Application - Run Spring Boot (main run config) 2. Database - Start database containers 3. Reset Database - Clean volumes and restart (Maven-based, auto-stops) All use IntelliJ Docker/Spring Boot/Maven integration (Windows/Mac/Linux). Reset Database uses exec-maven-plugin to run docker compose down -v. Stops automatically when complete.
This commit is contained in:
23
pom.xml
23
pom.xml
@@ -102,6 +102,29 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>docker-down</id>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>docker</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>compose</argument>
|
||||||
|
<argument>-f</argument>
|
||||||
|
<argument>docker-compose.dev.yml</argument>
|
||||||
|
<argument>down</argument>
|
||||||
|
<argument>-v</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -53,14 +53,14 @@ class RunConfigValidationTest {
|
|||||||
|
|
||||||
// Expected module name in run configs should match artifactId
|
// Expected module name in run configs should match artifactId
|
||||||
assertEquals("backend", artifactId,
|
assertEquals("backend", artifactId,
|
||||||
"pom.xml artifactId has changed. Update .idea/runConfigurations/PetshopBackendApplication.xml module name to match.");
|
"pom.xml artifactId has changed. Update run configuration files if needed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void runConfigurationFileExists() {
|
void runConfigurationFileExists() {
|
||||||
File runConfigFile = new File(".idea/runConfigurations/PetshopBackendApplication.xml");
|
File runConfigFile = new File(".idea/runConfigurations/Pet_Shop_Application.xml");
|
||||||
assertTrue(runConfigFile.exists(),
|
assertTrue(runConfigFile.exists(),
|
||||||
"Run configuration file missing. Ensure .idea/runConfigurations/ directory is committed to Git.");
|
"Main run configuration file missing. Ensure .idea/runConfigurations/ directory is committed to Git.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user