• Maven 常用配置


    代理

        <proxies>
            <proxy>
                <id>xxxxxx.proxy</id>
                <active>true</active>
                <protocol>http</protocol>
                <username>someone</username>
                <password>ask someone</password>
                <host>inetproxy3.ldn.xxxxxx</host>
                <port>8080</port>
                <nonProxyHosts>xxxxxx*</nonProxyHosts>
            </proxy>
        </proxies>

    镜像

      <mirrors>    
        <mirror>
            <id>ssts mr</id>
            <name>Internal Mirror of Central Repository</name>
            <url>http://xldn3162vdap.ldn.xxxxxx:8080/archiva/repository/internal</url>
            <!--<url>http://xxxxxx-build:9090/maven-repo/</url>-->
            <mirrorOf>central</mirrorOf>
        </mirror>
      </mirrors>

    仓库

      <profiles>
      
              <profile>
                <id>default</id>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
    
                <repositories>
                
                    <repository>
                        <id>ssts</id>
                        <name>Internal Mirror of Central Repository</name>
                        <releases>
                            <enabled>true</enabled>
                            <updatePolicy>never</updatePolicy>
                            <checksumPolicy>ignore</checksumPolicy>
                        </releases>
                        <snapshots>
                            <enabled>true</enabled>
                            <updatePolicy>never</updatePolicy>
                            <checksumPolicy>ignore</checksumPolicy>
                        </snapshots>
                        <url>http://xldn3162vdap.ldn.xxxxxx:8080/archiva/repository/internal</url>
                    </repository>                                
                    <repository>                
                        <id>ssts-fusa</id>
                        <name>Internal Mirror of Central Repository</name>
                        <releases>
                            <enabled>true</enabled>
                            <updatePolicy>never</updatePolicy>
                            <checksumPolicy>ignore</checksumPolicy>
                        </releases>
                        <snapshots>
                            <enabled>true</enabled>
                            <updatePolicy>never</updatePolicy>
                            <checksumPolicy>ignore</checksumPolicy>
                        </snapshots>
                        <url>http://xxxxxx-build:9090/maven-repo/</url>
                    </repository>                
                </repositories>        
    
                <pluginRepositories>
    
                    <pluginRepository>
                        <id>ssts</id>
                        <name>Internal Mirror of Central Plugins Repository</name>
                        <releases>
                            <enabled>true</enabled>
                            <updatePolicy>never</updatePolicy>
                            <checksumPolicy>ignore</checksumPolicy>
                        </releases>
                        <snapshots>
                            <enabled>true</enabled>
                            <updatePolicy>never</updatePolicy>
                            <checksumPolicy>ignore</checksumPolicy>
                        </snapshots>
                        <url>http://xldn3162vdap.ldn.xxxxxx:8080/archiva/repository/internal</url>
                    </pluginRepository>
        
                </pluginRepositories>
            </profile>
      </profiles> 
    View Code

    编译插件

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.5.1</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>

    打包Jar - 包含main方法

    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>2.5.1</version>
                    <excutions>
                        <excution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <transformers>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                        <mainClass>com.xxx.xxx.Class</mainClass>
                                    </transformer>
                                </transformers>
                            </configuration>
                        </excution>
                    </excutions>
                </plugin>
  • 相关阅读:
    HTML5和CSS3基础教程(第8版)-读书笔记(3)
    HTML5和CSS3基础教程(第8版)-读书笔记(2)
    HTML5和CSS3基础教程(第8版)-读书笔记
    JavaScript高级程序设计-读书笔记(7)
    HTTP状态码列表
    vue 监听对象里的特定数据
    vue 项目中命名方法
    一些常用文件夹和类的一些命名
    点将产品前端架构重构
    常用正则表达式总结
  • 原文地址:https://www.cnblogs.com/BenWong/p/3095070.html
Copyright © 2020-2023  润新知