31 Mayıs 2023 Çarşamba

plugin Kullanımı

Plugin Configuration
Açıklaması şöyle
- Each plugin has its own configuration parameters that define how it should execute.
- The configuration is specified within the <configuration> element of the plugin.
Örnek
Şöyle yaparız
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.8.1</version>
  <configuration>
    <source>1.8</source>
    <target>1.8</target>
  </configuration>
</plugin>
Plugin Execution
Açıklaması şöyle
- Plugins can be bound to specific phases of the build lifecycle using the <executions> element.
- Each execution can define one or more goals to be executed in a specific order.
Örnek
Şöyle yaparız
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>3.0.0-M5</version>
  <executions>
    <execution>
      <id>run-tests</id>
      <goals>
        <goal>test</goal>
      </goals>
    </execution>  
  </executions>
</plugin>
Plugin Dependency
Açıklaması şöyle
- Plugins can have their own dependencies, which are specified within the <dependencies> element.
- These dependencies are separate from project dependencies and are used to support the plugin’s functionality.
Örnek
Şöyle yaparız
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.8.1</version>
  <dependencies>
    <dependency>
      <groupId>com.example</groupId>
      <artifactId>custom-compiler</artifactId>
      <version>1.0.0</version>
    </dependency>
  </dependencies>
</plugin>
Plugin Management
Açıklaması şöyle
- Plugin management allows defining plugin versions and configurations in a central location within the <pluginManagement> section.
- This allows for consistent configuration across multiple projects.
Örnek
Şöyle yaparız
<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.8.1</version>
      <configuration>
        <source>1.8</source>
        <target>1.8</target>
      </configuration>
    </plugin>
  </plugins>
</pluginManagement>



Hiç yorum yok:

Yorum Gönder

Local Snapshot Kullanmak

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