[java|maven] pom.xml文件模板

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">
    <modelVersion>4.0.0modelVersion>
    <groupId>cn.com.xxx.xxxgroupId>
    <artifactId>xxx-xxxx-parentartifactId>
    <version>1.4.0-xxxversion>
    <packaging>pompackaging>
    <name>xxx xxx Parentname>

    <properties>
    	
        <xxx.version>1.4.0-xxxxxxx.version>
        <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
    properties>

	
    <modules>
        <module>coremodule>
        <module>distributionmodule>
    modules>
    
    
    <repositories>
        <repository>
            <id>aliyunid>
            <name>Aliyun Repositoryname>
            <url>http://maven.aliyun.com/repository/centralurl>
            <snapshots>
                <enabled>trueenabled>
            snapshots>
        repository>
    repositories>
    
    
    <distributionManagement>
        <repository>
            <id>xxxid>
            <name>xxx Releases Repositoryname>
            <url>http://repo.xxxx.cn:1111/repository/maven-releases/url>
        repository>
    distributionManagement>

	
    <build>
    	
        <plugins>
        	
            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-compiler-pluginartifactId>
                <version>3.1version>
                <configuration>
                    <source>1.8source>
                    <target>1.8target>
                    <encoding>${source.encoding}encoding>
                configuration>
            plugin>

			
			<plugin>
				<artifactId>maven-assembly-pluginartifactId>
				<version>2.4.1version>
				<executions>
					<execution>
						<id>binid>
						<phase>packagephase>
						<goals>
							<goal>attachedgoal>
						goals>
						<configuration>
							<descriptors>
								<descriptor>src/main/assemblies/bin.xmldescriptor>
							descriptors>
							<tarLongFileMode>gnutarLongFileMode>
						configuration>
					execution>
				executions>
			plugin>

			
			<plugin>
				<artifactId>exec-maven-pluginartifactId>
				<version>1.6.0version>
				<groupId>org.codehaus.mojogroupId>
				<executions>
					<execution>
						<id>Create auto runnable packageid>
						<phase>packagephase>
						<goals>
							<goal>execgoal>
						goals>
						<configuration>
							<executable>bashexecutable>
							<commandlineArgs>src/main/scripts/package.sh ${project.artifactId} ${project.version}commandlineArgs>
						configuration>
					execution>
				executions>
			plugin>
        plugins>
    build>
project>

bin.xml

<assembly>
	<id>binid>
	<formats>
		<format>tar.gzformat>
	formats>
	<includeBaseDirectory>trueincludeBaseDirectory>
	<fileSets>
		<fileSet>
			<includes>
				<include>conf/**include>
				<include>lib/**include>
			includes>
		fileSet>
		<fileSet>
			<directory>logdirectory>
			<outputDirectory>logoutputDirectory>
		fileSet>
		<fileSet>
			<directory>bindirectory>
			<outputDirectory>binoutputDirectory>
			<includes>
				<include>*.shinclude>
			includes>
			<fileMode>755fileMode>
		fileSet>
		<fileSet>
			<directory>../core/src/main/resourcesdirectory>
			<outputDirectory>confoutputDirectory>
			<includes>
				<include>logback.xmlinclude>
			includes>
		fileSet>
	fileSets>
	<dependencySets>
		<dependencySet>
			<outputDirectory>liboutputDirectory>
			<useProjectArtifact>falseuseProjectArtifact>
		dependencySet>
	dependencySets>
assembly>

你可能感兴趣的:(maven,java)