Maven

1. Introduction

     Maven is a project management tool. For example, XWorker's class library dependencies are managed by Maven. Official website address: https://maven.apache.org/.

2. Design ideas

  • Model to POM
    Configure pom.xml through the model.
      
  • Executable
    Execute Mavan through the model.

3.Example

<?xml version='1.0' encoding='utf-8'?>

<Pom descriptors="xworker.maven.MavenActions/@PomToString/@Pom,xworker.maven.Pom"
      projectDir="./target/swthelloworld/">
     <code><![CDATA[<?xml version="1.0" encoding="UTF-8"?>

<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">
<modelVersion>4.0.0</modelVersion>
	
<name>swthelloworld</name>
<description>SWT Hello World</description>
<artifactId>swthelloworld</artifactId>
<groupId>xworker</groupId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<argLine>-Dfile.encoding=UTF-8</argLine>
<!--<snapshot></snapshot>-->
</properties>
	
<build>
<plugins>
${plugins?if_exists}
</plugins>
</build>
<dependencies>
${dependencies?if_exists}
       <dependency>
           <groupId>org.xworker</groupId>
           <artifactId>xworker_swt</artifactId>
           <version>2.0.2-SNAPSHOT</version>
       </dependency>
</dependencies>
</project>]]></code>
     <Plugins name="plugins" _xmeta_id_="Plugins">
         <JavaPackager descriptors="xworker.maven.fvarrui.JavaPackager" version="1.7.0">
             <Configuration mainClass="xworker.helloworld.HelloWorld" bundleJre="true">
                 <WinConfig name="WinConfig" removeOldLibs="true"/>
             </Configuration>
         </JavaPackager>
     </Plugins>
</Pom>

 

Copyright ©  2007-2019 XWorker.org  版权所有  沪ICP备08000575号