Accueil‎ > ‎

JPA Define a dev / prod Data Source

posted 1 Mar 2019, 01:16 by Christophe Noël
No magic in there... you simply define a profile which copy the appropriate data source file (resource.xml)

  <profile>
      <id>cloud</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
       <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
              <webResources>
                <resource>
                  <!-- this is relative to the pom.xml directory -->
                  <directory>src/main/setup/cloud</directory>
                  <targetPath>WEB-INF</targetPath>
                </resource>
              </webResources>
            </configuration>
          </plugin>
        </plugins>
      </build>   
    </profile>
      
Comments