美文网首页
2024-01-24 配置1 maven

2024-01-24 配置1 maven

作者: 大也 | 来源:发表于2024-01-24 14:14 被阅读0次

1.maven内 标签

  1. <build>
    https://blog.csdn.net/weixin_40017062/article/details/122652358
    1.1) <resources>



    <resources>
    <resource>

    <directory>src/main/resources</directory>

    <filtering>true</filtering>
    </resource>
    </resources>
    1.2)。 <plugins>

    <plugins>
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>2.7.8</version>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.1.0</version>
    <configuration combine.self="override"></configuration>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>3.1.0</version>
    </plugin>
    <plugin>
    <groupId>io.fabric8</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>{docker.plugin.version}</version> <configuration> <dockerHost>{docker.host}</dockerHost>
    <registry>{docker.registry}</registry> <authConfig> <push> <username>{docker.username}</username>
    <password>{docker.password}</password> </push> </authConfig> <images> <image> <name>{docker.registry}/{docker.namespace}/{profiles.active}/{project.name}:{project.version}
    </name>
    <build>
    <dockerFile>${project.basedir}/Dockerfile</dockerFile>
    </build>
    </image>
    </images>
    </configuration>
    </plugin>
    </plugins>

2) <repositories> <pluginRepositories>



<repositories>

<repository>
<id>aliyun</id>
<name>aliyun</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>nexus</id>
<name>nexus</name>
<url>https://maven.geeboo.cn:8443/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun-plugin</id>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

3)<profiles>

<profiles>
    <profile>
        <id>dev</id>
        <properties>
            <!-- 环境标识,需要与配置文件的名称相对应 -->
            <profiles.active>dev</profiles.active>
        </properties>
    </profile>
    <profile>
        <id>test</id>
        <properties>
            <profiles.active>test</profiles.active>
        </properties>
        <activation>
            <!-- 默认环境 -->
            <activeByDefault>true</activeByDefault>
        </activation>
    </profile>
    <profile>
        <id>prod</id>
        <properties>
            <profiles.active>prod</profiles.active>
        </properties>
    </profile>
</profiles>

3.2)yaml
active: @profiles.active@

相关文章

网友评论

      本文标题:2024-01-24 配置1 maven

      本文链接:https://www.haomeiwen.com/subject/lftpodtx.html