首页 > 其他分享 >pom.xml标签学习

pom.xml标签学习

时间:2022-09-04 13:55:44浏览次数:70  
标签:xml project 标签 commons jboss pom apache org Final

java项目之pom.xml

以ysoserial的pom.xml为例分析

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    //project描述这个项目,xmlns命名空间,xmlns:xsi ——是指xml文件遵守xml规范,xsi全名:xml schema instance,是指具体用到的schema资源文件里定义的元素所准守的规范。xsi:schemaLocation——是指,本文档里的xml元素所遵守的规范,schemaLocation 属性用来引用(schema)模式文档,解析器可以在需要的情况下使用这个文档对 XML 实例文档进行校验。它的值(URI)是成对出现的,第一个值表示命名空间,第二个值则表示描述该命名空间的模式文档的具体位置,两个值之间以空格分隔。
   <modelVersion>4.0.0</modelVersion>//项目版本

   <groupId>ysoserial</groupId>///GroupID 是项目组织唯一的标识符,实际对应JAVA的包的结构,是main目录里java的目录结构。
   <artifactId>ysoserial</artifactId>//ArtifactID是项目的唯一的标识符,实际对应项目的名称,就是项目根目录的名称。
   <version>0.0.6-SNAPSHOT</version>//版本
   <packaging>jar</packaging>//打包方式

   <name>ysoserial</name>//项目名称
   <url>https://github.com/frohoff/ysoserial/</url>//地址

    <properties>//配置文件<name>value</name>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>//源代码使用utf-8编码
   </properties>

   <build>//描述biuld所需的plugins
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.1</version>
            <configuration>
               <!-- maximize compatibility -->
               <source>1.6</source>
               <target>1.6</target>
               <!-- ignore noisy internal api warnings -->
                    <compilerArgument>-XDignore.symbol.file</compilerArgument>
                    <fork>true</fork>
                </configuration>
         </plugin>
         <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
               <finalName>${project.artifactId}-${project.version}-all</finalName>//编译打包之后的文件名格式
               <appendAssemblyId>false</appendAssemblyId>//Set to false to exclude the assembly id from the assembly final name, and to create the resultant assembly artifacts without classifier. As such, an assembly artifact having the same format as the packaging of the current Maven project will replace the file for this main project artifact.暂不理解
               <archive>//归档构建器的说明
                  <manifest>//清单文件
                     <mainClass>ysoserial.GeneratePayload</mainClass>
                  </manifest>
               </archive>
                    <descriptor>assembly.xml</descriptor>//描述文件
                </configuration>
            <executions>//executions:plugin也有很多个目标,每个目标具有不同的配置,executions就是设定plugin的目标。
               <execution>
                  <id>make-assembly</id>//The identifier of this execution for labelling the goals during the build, and for matching exections to merge during inheritance.
                  <phase>package</phase>
                  <goals>
                     <goal>single</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M1</version>
              <configuration>
                 <trimStackTrace>false</trimStackTrace>
                 <systemPropertyVariables>
                    <java.rmi.server.useCodebaseOnly>false</java.rmi.server.useCodebaseOnly>
                 </systemPropertyVariables>
              </configuration>
          </plugin>
      </plugins>
   </build>

   <repositories>//The lists of the remote repositories for discovering dependencies and extensions.
      <repository>
         <id>jenkins</id>
         <layout>default</layout>
         <url>https://repo.jenkins-ci.org/public/</url>
      </repository>
   </repositories>

   <dependencies>//This element describes all of the dependencies associated with a project. These dependencies are used to construct a classpath for your project during the build process. They are automatically downloaded from the repositories defined in this project.

      <!-- testing depedencies -->

      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>4.12</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito-core</artifactId>
         <version>1.10.19</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.github.stefanbirkner</groupId>
         <artifactId>system-rules</artifactId>
         <version>1.8.0</version>
         <scope>test</scope>//应用范围
      </dependency>
      <dependency>
         <groupId>org.nanohttpd</groupId>
         <artifactId>nanohttpd</artifactId>
         <version>2.2.0</version>
         <scope>test</scope>
      </dependency>


      <!-- non-gadget dependencies -->

      <dependency>
         <groupId>org.reflections</groupId>
         <artifactId>reflections</artifactId>
         <version>0.9.9</version>
      </dependency>
      <dependency>
         <groupId>org.jboss.shrinkwrap.resolver</groupId>
         <artifactId>shrinkwrap-resolver-depchain</artifactId>
         <version>2.2.6</version>
         <type>pom</type>
      </dependency>
      <dependency>
         <groupId>org.javassist</groupId>
         <artifactId>javassist</artifactId>
         <version>3.19.0-GA</version>
      </dependency>
      <dependency>
         <groupId>com.nqzero</groupId>
         <artifactId>permit-reflect</artifactId>
         <version>0.3</version>
      </dependency>
      <dependency>
         <groupId>commons-codec</groupId>
         <artifactId>commons-codec</artifactId>
         <version>1.9</version>
      </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
        </dependency>
      <dependency>
         <artifactId>remoting</artifactId>
         <groupId>org.jenkins-ci.main</groupId>
         <version>2.55</version>
      </dependency>
      <dependency>
         <groupId>org.jboss.logging</groupId>
         <artifactId>jboss-logging</artifactId>
         <version>3.3.0.Final</version>
      </dependency>
      <dependency>
         <groupId>org.jboss.remoting</groupId>
         <artifactId>jboss-remoting</artifactId>
         <version>4.0.19.Final</version>
      </dependency>
      <dependency>
         <groupId>org.jboss</groupId>
         <artifactId>jboss-common-core</artifactId>
         <version>2.5.0.Final</version>
         <exclusions>
            <exclusion>
               <groupId>org.jboss.logging</groupId>
               <artifactId>jboss-logging-spi</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.jboss.xnio</groupId>
         <artifactId>xnio-nio</artifactId>
         <version>3.3.4.Final</version>
      </dependency>
      <dependency>
         <groupId>org.jboss.sasl</groupId>
         <artifactId>jboss-sasl</artifactId>
         <version>1.0.5.Final</version>
      </dependency>
      <dependency>
         <groupId>org.jboss.remotingjmx</groupId>
         <artifactId>remoting-jmx</artifactId>
         <version>2.0.1.Final</version>
      </dependency>

      <!-- gadget dependecies -->

      <dependency>
         <groupId>commons-collections</groupId>
         <artifactId>commons-collections</artifactId>
         <version>3.1</version>
      </dependency>
      <dependency>
         <groupId>org.beanshell</groupId>
         <artifactId>bsh</artifactId>
         <version>2.0b5</version>
      </dependency>
      <dependency>
         <groupId>commons-beanutils</groupId>
         <artifactId>commons-beanutils</artifactId>
         <version>1.9.2</version>
      </dependency>
      <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-collections4</artifactId>
         <version>4.0</version>
      </dependency>
      <dependency>
         <groupId>org.codehaus.groovy</groupId>
         <artifactId>groovy</artifactId>
         <version>2.3.9</version>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-core</artifactId>
         <version>4.1.4.RELEASE</version>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-beans</artifactId>
         <version>4.1.4.RELEASE</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-core</artifactId>
         <version>4.3.11.Final</version>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-aop</artifactId>
         <version>4.1.4.RELEASE</version>
      </dependency>
      <dependency>
         <groupId>net.sf.json-lib</groupId>
         <artifactId>json-lib</artifactId>
         <classifier>jdk15</classifier>
         <version>2.4</version>
      </dependency>
      <dependency>
         <groupId>commons-fileupload</groupId>
         <artifactId>commons-fileupload</artifactId>
         <version>1.3</version>
      </dependency>
        <dependency>
         <groupId>org.apache.wicket</groupId>
         <artifactId>wicket-util</artifactId>
         <version>6.23.0</version>
      </dependency>
      <dependency>
         <groupId>com.mchange</groupId>
         <artifactId>c3p0</artifactId>
         <version>0.9.5.2</version>
      </dependency>
      <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>javax.servlet-api</artifactId>
         <version>3.1.0</version>
      </dependency>
      <dependency>
         <groupId>org.apache.myfaces.core</groupId>
         <artifactId>myfaces-impl</artifactId>
         <version>2.2.9</version>
      </dependency>
      <dependency>
         <groupId>xalan</groupId>
         <artifactId>xalan</artifactId>
         <version>2.7.2</version>
      </dependency>
      <dependency>
         <groupId>rome</groupId>
         <artifactId>rome</artifactId>
         <version>1.0</version>
      </dependency>
        <dependency>
            <groupId>org.python</groupId>
            <artifactId>jython-standalone</artifactId>
            <version>2.5.2</version>
        </dependency>
      <dependency>
         <groupId>rhino</groupId>
         <artifactId>js</artifactId>
         <version>1.7R2</version>
      </dependency>
      <dependency>
      <groupId>javassist</groupId>
      <artifactId>javassist</artifactId>
      <version>3.12.0.GA</version>
      </dependency>
      <dependency>
         <groupId>org.jboss.weld</groupId>
         <artifactId>weld-core</artifactId>
         <version>1.1.33.Final</version>
      </dependency>
      <dependency>
         <groupId>org.jboss.interceptor</groupId>
         <artifactId>jboss-interceptor-core</artifactId>
         <version>2.0.0.Final</version>
      </dependency>
      <dependency>
         <groupId>org.jboss.interceptor</groupId>
         <artifactId>jboss-interceptor-spi</artifactId>
         <version>2.0.0.Final</version>
      </dependency>
      <dependency>
         <groupId>javax.enterprise</groupId>
         <artifactId>cdi-api</artifactId>
         <version>1.0-SP1</version>
      </dependency>
      <dependency>
         <groupId>javax.interceptor</groupId>
         <artifactId>javax.interceptor-api</artifactId>
         <version>3.1</version>
      </dependency>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
         <version>1.7.21</version>
      </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.7.21</version>
        </dependency>
      <dependency>
         <groupId>org.clojure</groupId>
         <artifactId>clojure</artifactId>
         <version>1.8.0</version>
      </dependency>
      <dependency>
         <groupId>com.vaadin</groupId>
         <artifactId>vaadin-server</artifactId>
         <version>7.7.14</version>
      </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.9.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.click</groupId>
            <artifactId>click-nodeps</artifactId>
            <version>2.3.0</version>
        </dependency>
   </dependencies>

   <profiles>// A listing of project-local build profiles which will modify the build process when activated.用于区分测试包和发行包,并配置不同的环境
        <profile>
            <id>jdk6</id>
            <activation>
                <jdk>1.6</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.22.1</version>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>javax.el</groupId>
                    <artifactId>javax.el-api</artifactId>
                    <version>3.0.0</version>
                </dependency>
            </dependencies>
            <!-- workaround for non-overlapping TLS versions in JDK6 and central repo
             https://central.sonatype.org/articles/2018/May/04/discontinued-support-for-tlsv11-and-below/ -->
            <repositories>
                <repository>
                    <id>repo1</id>
                    <url>http://repo1.maven.org/maven2</url><!-- intentionally http (see above) -->
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>repo1</id>
                    <url>http://repo1.maven.org/maven2</url><!-- intentionally http (see above) -->
                </pluginRepository>
            </pluginRepositories>
        </profile>

      <profile>
         <id>hibernate5</id>
         <activation>
            <property>
               <name>hibernate5</name>
            </property>
         </activation>
         <dependencies>
            <dependency>
               <groupId>org.hibernate</groupId>
               <artifactId>hibernate-core</artifactId>
               <version>5.0.7.Final</version>
            </dependency>
                <dependency>
                    <groupId>javax.el</groupId>
                    <artifactId>javax.el-api</artifactId>
                    <version>3.0.0</version>
                </dependency>
         </dependencies>
      </profile>

      <profile>
         <id>apache-el</id>
         <activation>
            <activeByDefault>true</activeByDefault>
            <property>
               <name>el</name>
               <value>apache</value>
            </property>
         </activation>
         <dependencies>
            <dependency>
               <groupId>org.mortbay.jasper</groupId>
               <artifactId>apache-el</artifactId>
               <version>8.0.27</version>
            </dependency>
         </dependencies>
      </profile>

      <profile>
         <id>juel</id>
         <activation>
            <property>
               <name>el</name>
               <value>juel</value>
            </property>
         </activation>
         <dependencies>
            <dependency>
               <groupId>de.odysseus.juel</groupId>
               <artifactId>juel-impl</artifactId>
               <version>2.2.7</version>
            </dependency>
            <dependency>
               <groupId>de.odysseus.juel</groupId>
               <artifactId>juel-api</artifactId>
               <version>2.2.7</version>
            </dependency>
         </dependencies>
      </profile>

   </profiles>
    <distributionManagement>//Distribution information for a project that enables deployment of the site and artifacts to remote web servers and repositories respectively.告知我们项目发布地址
        <repository>
            <id>github</id>
            <name>GitHub Packages</name>
            <url>https://maven.pkg.github.com/frohoff/ysoserial</url>
        </repository>
    </distributionManagement>  
</project>

注释中解释的一知半解,pom配置需要长时间的项目开发经验的积累,由于笔者仅仅用于java安全测试,所以无法知其全貌,IDEA中出现对标签的概括,可以进行学习。

标签:xml,project,标签,commons,jboss,pom,apache,org,Final
From: https://www.cnblogs.com/Sovohost-43/p/16654974.html

相关文章

  • Could not find artifact org.pentaho:pentaho-aggdesigner-algorithm:pom:5.1.5-jhyd
    在Spark连接Hive导入相关maven依赖时<dependency><groupId>org.apache.hive</groupId><artifactId>hive-exec</artifactId><version>2.3.4</version></de......
  • Kubernetes-标签
    Kubernetes标签什么是Kubernetes标签标签(Labels)是附加到Kubernetes对象(比如Pods)上的键值对。标签示例如下:"metadata":{"labels":{"key1":"value1",......
  • mapper接口和xml文件都么有问题,但是查询不出数据
    mapper接口和xml文件都么有问题,但是查询不出数据在开发的时候遇到mapper.接口及xml文件都没有问题,控制台输出sql及参数也是正常的,但是total数据是0,那么看一下项目当前......
  • VScode设置标签中的属性自动换行
    问题描述很多时候,在编写Vue代码时经常需要添加很多的属性,往往这时候就会采用一个属性一行的代码格式,但是格式化代码又会将其合并为一行,如果每次都手动进行换行,又会非常影......
  • JavaConfig和XML之间的互相引用
    JavaConfig引用JavaConfig  现在,我们临时假设PersonConfig已经变得有些笨重,我们想要将其进行拆分。当然,它目前只定义了两个bean,远远称不上复杂的Spring配置。不过......
  • ASP.NET Core 实战-8.使用标签助手构建表单
    显示动态数据是许多Web应用程序的一个重要方面,但它通常只是故事的一半。除了向用户显示数据之外,您通常还需要用户能够将数据提交回您的应用程序。例如,您可以使用数据来......
  • HTML——hr标签&注释
    hr标签:添加水平线<html><body><p>hr标签定义水平线:</p><hr/><p>这是段落。</p><hr/><p>这是段落。</p><hr/><p>这是段落。</p></body></html>注释:可......
  • HTML——br标签
    <br/>标签:如果您希望在不产生一个新段落的情况下进行换行(新行),请使用<br/>标签:<br>还是<br/>您也许发现<br>与<br/>很相似。在XHTML、XML以及未来的HTML......
  • 引入版本问题 spring-cloud版本:Finchley.RC1 和 spring-boot版本:2.0.4.RELEASE No
    springcloud和springboot引入版本问题spring-cloud版本:Finchley.RC1spring-boot版本:2.0.4.RELEASE改为:spring-cloud版本:Finchley.RELEASEspring-boot版本:2.0.3.R......
  • Vue的列表超链接(A标签)是什么?如何实现跳转呢?
    方法一:通过<router-link:to="">我要跳转,别拦我</router-link>首页列表:在这里我用a标签进行跳转,在vue里面使用<router-link></router-link>  //注意:这里的router-lin......