精华内容
下载资源
问答
  • maven skip参数一次坑

    2020-09-25 11:24:53
    maven配置生效命令 用到maven配置生效文件命令 mvn help:effective-settings -Doutput=effective-settings.xml maven 查看当前pom具体命令 mvn help:effective-pom -Doutput=effective-pom.xml maven只打包,...

    mvn 打包遇到问题

    maven配置生效命令

    用到maven配置生效文件命令

    mvn help:effective-settings -Doutput=effective-settings.xml

     

    maven 查看当前pom具体命令

    mvn help:effective-pom -Doutput=effective-pom.xml

    maven只打包,不上传切勿这么搞。

    展开全文
  • 如何配置maven skip Test

    2010-12-27 11:46:56
    配置maven skip Test [code="java"] true true org.apache.maven.plugins maven-surefire-plugin ${maven.test.skip} ${maven.test.failure.ignore} [/code]
    配置maven skip Test
    

    <properties>
    <maven.test.skip>true</maven.test.skip>
    <maven.test.failure.ignore>true</maven.test.failure.ignore>
    </properties>

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
    <skip>${maven.test.skip}</skip>
    <testFailureIgnore>${maven.test.failure.ignore}</testFailureIgnore>
    </configuration>
    </plugin>
    展开全文
  • 我的maven setting.xml <?xml version="1.0" encoding="UTF-8"?> <!-- | This is the configuration file for Maven. It can be specified at two levels: | | 1. User Level. This settings.xml file ...

    我的maven setting.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!--
     | This is the configuration file for Maven. It can be specified at two levels:
     |
     |  1. User Level. This settings.xml file provides configuration for a single user,
     |                 and is normally provided in ${user.home}/.m2/settings.xml.
     |
     |                 NOTE: This location can be overridden with the CLI option:
     |
     |                 -s /path/to/user/settings.xml
     |
     |  2. Global Level. This settings.xml file provides configuration for all Maven
     |                 users on a machine (assuming they're all using the same Maven
     |                 installation). It's normally provided in
     |                 ${maven.home}/conf/settings.xml.
     |
     |                 NOTE: This location can be overridden with the CLI option:
     |
     |                 -gs /path/to/global/settings.xml
     |
     | The sections in this sample file are intended to give you a running start at
     | getting the most out of your Maven installation. Where appropriate, the default
     | values (values used when the setting is not specified) are provided.
     |
     |-->
    <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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
      <!-- localRepository
         本地仓库路径
        <localRepository>/path/to/local/repo</localRepository>
        -->
      <localRepository>D:\Java Program Files\apache-maven-3.5.4\repository</localRepository>
      <!-- interactiveMode
         | This will determine whether maven prompts you when it needs input. If set to false,
         | maven will use a sensible default value, perhaps based on some other setting, for
         | the parameter in question.
         |
         | Default: true
        <interactiveMode>true</interactiveMode>
        -->
    
      <!-- offline
         | Determines whether maven should attempt to connect to the network when executing a build.
         | This will have an effect on artifact downloads, artifact deployment, and others.
         |
         | Default: false
        <offline>false</offline>
        -->
    
      <!-- pluginGroups
         | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
         | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
         | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
         |-->
      <pluginGroups>
        <!-- pluginGroup
             | Specifies a further group identifier to use for plugin lookup.
            <pluginGroup>com.your.plugins</pluginGroup>
            -->
    
      </pluginGroups>
    
      <!-- proxies
         | This is a list of proxies which can be used on this machine to connect to the network.
         | Unless otherwise specified (by system property or command-line switch), the first proxy
         | specification in this list marked as active will be used.
         |-->
      <proxies>
        <!-- proxy
             | Specification for one proxy, to be used in connecting to the network.
             |
            <proxy>
              <id>optional</id>
              <active>true</active>
              <protocol>http</protocol>
              <username>proxyuser</username>
              <password>proxypass</password>
              <host>proxy.host.net</host>
              <port>80</port>
              <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
            </proxy>
            -->
      </proxies>
    
      <!-- servers
         | This is a list of authentication profiles, keyed by the server-id used within the system.
         | Authentication profiles can be used whenever maven must make a connection to a remote server.
         |-->
      <servers>
        <!-- server
             | Specifies the authentication information to use when connecting to a particular server, identified by
             | a unique name within the system (referred to by the 'id' attribute below).
             |
             | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
             |       used together.
             |
            <server>
              <id>deploymentRepo</id>
              <username>repouser</username>
              <password>repopwd</password>
            </server>
            -->
    
        <server>
          <!-- 和pom.xml文件中 distributionManagement.repository.id 一致-->
          <id>maven-release</id>
          <username>maven_deploy</username>
          <password>maven_deploy</password>
        </server>
        <server>
          <!-- 和pom.xml文件中 distributionManagement.snapshotRepository.id 一致-->
          <id>maven-snapshot</id>
          <username>maven_deploy</username>
          <password>maven_deploy</password>
        </server>
    
        <!-- Another sample, using keys to authenticate.
            <server>
              <id>siteServer</id>
              <privateKey>/path/to/private/key</privateKey>
              <passphrase>optional; leave empty if not used.</passphrase>
            </server>
            -->
        <!--     <server>
                  <id>release</id>
                  <username>admin</username>
                  <password>admin123</password>
                </server> -->
        <server>
          <id>serverid</id>
          <username>xuyuansheng</username>
          <password>xxxx.mv</password>
        </server>
      </servers>
    
      <!-- mirrors
         | This is a list of mirrors to be used in downloading artifacts from remote repositories.
         |
         | It works like this: a POM may declare a repository to use in resolving certain artifacts.
         | However, this repository may have problems with heavy traffic at times, so people have mirrored
         | it to several places.
         |
         | That repository definition will have a unique id, so we can create a mirror reference for that
         | repository, to be used as an alternate download site. The mirror site will be the preferred
         | server for that repository.
         |-->
      <mirrors>
        <!-- mirror
             | Specifies a repository mirror site to use instead of a given repository. The repository that
             | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
             | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
             |
              <mirror>
                <id>release</id>
                <name>local Central</name>
                <url>http://192.168.1.129:9081/content/groups/public/</url>
               <mirrorOf>central</mirrorOf>
              </mirror> -->
        <mirror>
          <!-- 配置镜像,多个mirrorOf相同时第一个生效 -->
          <id>alimaven</id>
          <name>aliyun maven</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <mirrorOf>central</mirrorOf>
        </mirror>
      </mirrors>
    
      <!-- profiles
         | This is a list of profiles which can be activated in a variety of ways, and which can modify
         | the build process. Profiles provided in the settings.xml are intended to provide local machine-
         | specific paths and repository locations which allow the build to work in the local environment.
         |
         | For example, if you have an integration testing plugin - like cactus - that needs to know where
         | your Tomcat instance is installed, you can provide a variable here such that the variable is
         | dereferenced during the build process to configure the cactus plugin.
         |
         | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
         | section of this document (settings.xml) - will be discussed later. Another way essentially
         | relies on the detection of a system property, either matching a particular value for the property,
         | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
         | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
         | Finally, the list of active profiles can be specified directly from the command line.
         |
         | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
         |       repositories, plugin repositories, and free-form properties to be used as configuration
         |       variables for plugins in the POM.
         |
         |-->
      <profiles>
    
        <profile>
    
          <id>jdk-1.8</id>
          <activation>
            <!-- 默认激活 -->
            <activeByDefault>true</activeByDefault>
            <!-- 设置maven默认的 jdk 为 1.8 -->
            <jdk>1.8</jdk>
          </activation>
          <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
            <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <maven.test.skip>true</maven.test.skip>
            <gpg.homedir>${user.home}/.gnupg</gpg.homedir>
            <gpg.keyname>C94E2A49</gpg.keyname>
            <gpg.passphrase>xxxxx</gpg.passphrase>
          </properties>
    
    
          <repositories>
            <!-- 配置多个仓库,多个同时生效 -->
            <repository>
              <id>alimaven</id>
              <name>aliyun maven</name>
              <!-- <url>http://maven.aliyun.com/nexus/content/groups/public/</url> -->
              <url>https://maven.aliyun.com/repository/public</url>
            </repository>
            <repository>
              <id>central</id>
              <name>central</name>
              <url>https://repo.maven.apache.org/maven2</url>
            </repository>
          </repositories>
    
        </profile>
    
      </profiles>
    
      <!-- activeProfiles
         | List of profiles that are active for all builds.
         |
        <activeProfiles>
          <activeProfile>alwaysActiveProfile</activeProfile>
          <activeProfile>anotherAlwaysActiveProfile</activeProfile>
        </activeProfiles>
        -->
    </settings>
    
    展开全文
  • maven跳过单元测试--maven skip test

    万次阅读 2016-10-27 14:22:05
    你可能想要配置 Maven 使其完全跳过单元测试。 可能你有一个很大的系统,单元测试需要花好多分钟来完成,而你不想在生成最终输出前等单元测试完成。 你可能正工作在一个遗留系统上面,这个系统有一系列的失败的单元...

    你可能想要配置 Maven 使其完全跳过单元测试。 可能你有一个很大的系统,单元测试需要花好多分钟来完成,而你不想在生成最终输出前等单元测试完成。 你可能正工作在一个遗留系统上面,这个系统有一系列的失败的单元测试,你可能仅仅想要生成一个 JAR 而不是去修复所有的单元测试。 Maven 提供了跳过单元测试的能力,只需要使用 Surefire 插件的 skip 参数。 在命令行,只要简单的给任何目标添加 maven.test.skip 属性就能跳过测试:

      

    $ mvn install -Dmaven.test.skip=true
    ...
    [INFO] [compiler:testCompile]
    [INFO] Not compiling test sources
    [INFO] [surefire:test]
    [INFO] Tests are skipped.
    ...

     

    当 Surefire 插件到达 test 目标的时候,如果 maven.test.skip 设置为 true ,它就会跳过单元测试。 另一种配置 Maven 跳过单元测试的方法是给你项目的 pom.xml 添加这个配置。 你需要为你的 build 添加 plugin 元素。

     

    <project>
      [...]
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
      [...]
    </project>


    转自http://blog.csdn.net/symgdwyh/article/details/4289080


    展开全文
  • IntelliJ IDEA的Maven项目有时候通过右边Maven Projects面板的package或者install命令打包的时候,会报错导致打包失败,这是由于这两个命令打包前...展开左侧Maven Projects面板,顶部有一个Toggle 'Skip Tests' Mode
  • skip跳出Maven自定义插件

    千次阅读 2017-12-21 09:04:27
    有时候,不需要执行某个自定义插件,可以向mojo传入一个skip参数。如图: 通过configuration标签传。 后端收到参数后,执行跳过操作,如图: 获取参数: 然后判断,如图: 执行mvn命令,增加跳过...
  • pom文件中可以通过定义skipTests来跳过单元测试 ...org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.2</...
  • maven指定配置文件打包

    千次阅读 2019-06-28 12:26:35
    pom.xml中添加: <!... <id>sourceforge ... <url>http://maven.oschina.net/content/groups/public/</url> ... <groupId>org.apache....classes中的配置文件正是打包命令所选择的resources.prod文件夹中的配置文件
  • idea-全局默认maven配置

    千次阅读 2020-01-18 18:28:58
    在项目实战中我们依赖的... 比如我们在每次新导入项目 的时候常修改的:编译版本、Maven本地库路径等,我们在正常设置Project流程的过程中,这些操作并没有被当做一个标砖的IDE设置模板保存起来,因此下次打开新...
  • Maven 项目中配置私服

    千次阅读 2018-11-13 23:01:39
     2、配置本地Maven的settings.xml文件(maven安装目录下的conf文件夹下;setting文件的结构参考: maven全局配置文件settings.xml详解 )  (1)在servers节点下配置server,上传私服的权限 <servers> <!...
  • IDEA——Maven配置与使用

    千次阅读 2020-09-06 07:42:08
    简单介绍一下如何在 idea 中配置maven,以及如何去使用 maven 。 一、配置 Maven home Maven home 和 settings 文件一般都需要进行重新设置,关联到本机已经安装好的 maven 版本,settings 这里可以使用默认,也...
  • 为了跳过maven的单元测试做了如下一个小小的改动,结果花费半天时间才找到是它搞的鬼,导致工程在打包的时候,提示打包成功,但是没有清单文件及依赖的jar。花费好长时间才找到问题。 被坑的还有这位老兄,呵呵。 ...
  • maven 编译配置

    2017-05-09 22:07:00
    2019独角兽企业重金招聘Python工程师标准>>> ... <groupId>org.apache.maven.plugins... <skip>true</skip> 转载于:https://my.oschina.net/u/3238650/blog/896284
  • IDEA配置Maven(详细版)

    万次阅读 多人点赞 2020-05-14 10:29:47
    IDEA配置MavenIDEA创建Maven工程第一节 IDEA集成Maven插件第二节 使用骨架创建Maven的java工程第三节 不使用骨架创建Maven的java工程第四节 使用骨架创建Maven的java web工程第五节 不使用骨架创建Maven的java web...
  • Jenkins使用, maven插件配置修改

    千次阅读 2018-12-13 17:17:56
    今天要将项目 构建-测试-打包-上传docker镜像 流程放到jenkins上。...建立好maven项目再配置一些信息后基本正常。 如图: 配置git仓库和分支(只有test分支变动会触发构建) 每5分钟检查一次是否要执行构建 ...
  • Maven配置文件示例

    2020-06-04 11:55:37
    在本文中,我们将向您展示一些Maven配置文件示例,这些示例可为不同的环境(开发,测试或生产)传递不同的参数(服务器或数据库参数)。 PS已通过Maven 3.5.3测试 1.基本的Maven配置文件 1.1跳过单元测试的...
  • Maven skip Test

    2017-03-20 21:42:45
    方式1:用命令带上参数 ...mvn install -Dmaven.test.skip=true   方式2:在pom.xml里面配置 properties> config.id>defaultconfig.id> true spring.version>3.0.5.RELEASEspring.version>
  • Maven安装和配置 第一步:下载Maven的压缩包文件,官网路径http://maven.apache.org/download.cgi 第二步:添加 M2_HOME 和 MAVEN_HOME 添加 M2_HOME 和 MAVEN_HOME 环境变量到 Windows 环境变量,并将其指向你的 ...
  • 公司有私服,需要配置多个数据源,去不同的位置下载不同的包。 一些项目更新后,上传到私服上面,如何配置,直接打包上传到私服。 配置 多mirrors配置 <mirror> <id>mirror</id> <mirrorOf&...
  • Maven filter 配置的使用

    2015-10-31 15:39:56
    通过 Maven 的 filters 机制对不同环境(开发、预发布、生产)应用不同的配置信息   步骤 1. 首先需要配置 profile 信息,在不同的 profile 中指定变量 “env”为不同的值 &lt;profiles&gt; &...
  • java maven项目读取配置文件信息

    千次阅读 2018-12-14 17:33:08
    <skip>true</skip> <groupId>org.apache.maven.plugins <artifactId>maven-jar-plugin <version>3.0.2 <addClasspath>true <mainClass>com.tomy.hive.App</mainClass> <artifactId>...
  • git配置: 1.生成公钥,在git bash下输入: ssh-keygen -t rsa -C “自定义的名字” -f ~/.ssh/自定义的名字,不需要设置passphrase,一直回车直到key生成。 2.将xxx.pub公钥文件的内容添加注册页面的Add SSH Publi ...
  • maven指定配置文件

    2021-09-04 22:20:52
    mvn -s "d:\settins.xml" clean install -Dmaven.test.skip=true
  • Jenkins maven自动发布配置

    千次阅读 2018-07-13 18:06:45
    说明:jenkins maven svn实现自动编译及自动发布,svn也可以切换成git,看自己需要!之前也配置过几次,都...具体配置主要分为几步:一、环境准备(配置JDK,MAVEN,TOMCAT,SVN);二、jenkins安装;三、jenkins基础配置;...
  • Sonar maven配置

    2018-01-05 03:37:31
    title: Sonar maven配置 tags: Sonar Maven categories: 工作日志 date: 2017-02-25 18:18:55 在根pom增加sonar的url &lt;sonar.host.url&gt;http://XXXXX&lt;/sonar.host.url&gt; 复制代码...
  • 每次项目部署上线都需要手动去修改配置文件(比如数据库配置)然后才能打包,很不方便,可以根据以下教程用maven的profile 实现多环境的配置。 以数据库的配置为例,在src/main/resources 下新建三个文件夹,分别...
  • maven配置Tomcat

    2017-06-28 11:50:04
    1、配置tomcat管理用户及权限: Tomcat conf 下的tomcat-users.xml 增加以下内容: Java代码  "admin-gui"/>  "admin-script"/>  "manager-gui"/>  "manager-script"/>  "manager-jmx"/>  ...
  • 文章目录Spring Boot —— Maven Profile多配置前言实现步骤截图项目地址 Spring Boot —— Maven Profile多配置 前言 通过maven管理多环境,达到快速切换和部署效果。可以在Jenkins环境使用maven命令执行不同客户端...
  • maven命令,跳过单元测试-maven.test.skip和skipTests的区别 -DskipTests,不执行测试用例,但是会编译测试用例类,并且会生成相应的class文件,而且此文件放置在target/test-classes下。 -Dmaven.test.skip=true...
  • MAVEN插件介绍和配置

    千次阅读 2018-10-29 14:38:46
    MAVEN插件介绍及配置   一、介绍 maven-antrun-plugin http://maven.apache.org/plugins/maven-antrun-plugin/ maven-antrun-plugin能让用户在Maven项目中运行Ant任务。用户可以直接在该插件的配置以Ant的方式...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 19,878
精华内容 7,951
关键字:

mavenskip配置