3 Kasım 2022 Perşembe

profile tag

Giriş
profile tag tag başına maven projesi gibi. İçine bir sürü farklı alt tag alabiliyor

dependency Tanımlama
Örnek
Şöyle yaparız
<dependencies>
  <!-- Common dependencies -->
    
  <profiles>
    <profile>
      <id>dev</id>
      <dependencies>
        <!-- Dev-specific dependencies -->
      </dependencies>
    </profile>
    <profile>
      <id>prod</id>
      <dependencies>
        <!-- Prod-specific dependencies -->
      </dependencies>
    </profile>
  </profiles>
</dependencies>
module Tanımlama
Açıklaması şöyle
You can apply profile-specific configurations by using the <activation> section within each profile. 

Örnek
Şöyle yaparız
<profile>
  <id>mymodule-tests</id>
  <activation>
    <property>
      <name>!quick</name>
    </property>
    <jdk>[9,)</jdk>
  </activation>
  <modules>
    <module>modulepath-tests</module>
  </modules>
</profile>
plugin Tanımlama
Örnek
Şöyle yaparız
<profiles>
   <profile>
      <id>unit-test</id>
      <build>
         <plugins>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <configuration>
                  <includes>
                     <include>**/Test*.java</include>
                  </includes>
               </configuration>
            </plugin>
         </plugins>
      </build>
   </profile>
   <profile>
      <id>integration-test</id>
      <build>
         <plugins>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <configuration>
                  <includes>
                     <include>**/IntegrationTest*.java</include>
                  </includes>
               </configuration>
            </plugin>
         </plugins>
      </build>
   </profile>

</profiles>
property Tanımlama
Örnek
Şöyle yaparız
<profiles>
  <profile>
    <id>dev</id>
    <properties>
      <env>development</env>
    </properties>
  </profile>
  <profile>
    <id>prod</id>
    <properties>
      <env>production</env>
    </properties>
  </profile>
</profiles>
Örnek
Properties vermek için şöyle yaparız
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers/>
  <profiles>
    <profile>
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        ...
      </properties>
    </profile>
  </profiles>
</settings>

Hiç yorum yok:

Yorum Gönder

Local Snapshot Kullanmak

Örnek Şöyle yaparız <repository> <id>snapshot-repository</id> <name>Maven2 Snapshot Repository</name> &l...