maven 打包.bat文件和安装jar到仓库

直接上pom.xml

<build>
    <resources>
        <resource>
            <directory>resourcesdirectory>
                <includes>
                    <include>main.propertiesinclude>
                includes>
        resource>
    resources>

    <plugins>
      <plugin>
        <groupId>org.codehaus.mojogroupId>
        <artifactId>appassembler-maven-pluginartifactId>
        <version>1.2.1version>
        <executions>
          <execution>
            <id>make-assemblyid>
            <phase>packagephase>
            <goals>
              <goal>assemblegoal>
            goals>
          execution>
        executions>

        <configuration>
          
          <repositoryLayout>flatrepositoryLayout>
          
       <assembleDirectory>${project.build.directory}/cossimassembleDirectory>
          
          <extraJvmArguments>-Xms128mextraJvmArguments>
          <binFileExtensions>
            <unix>.shunix>
          binFileExtensions>
          <platforms>
            <platform>windowsplatform>
            <platform>unixplatform>
          platforms>
          <repositoryName>librepositoryName>
          <programs>
            <program>
              
              <mainClass>com.hitales.tools.cossim.CosCompareToolmainClass>
              
              <name>startname>
            program>
          programs>
        configuration>
      plugin>

      <plugin>
        <groupId>org.apache.maven.pluginsgroupId>
        <artifactId>maven-compiler-pluginartifactId>
        <configuration>
          <source>1.7source>
          <target>1.7target>
           <encoding>UTF-8encoding>
         configuration>
      plugin>
    plugins>
  build>

安装jar 到maven仓库 ,进入jar所在目录,运行

mvn install:install-file -Dfile=je-analysis-1.5.3.jar -DgroupId=je-analysis -DartifactId=je-analysis -Dversion=1.5.3 -Dpackaging=jar

选择run as maven clean ,然后maven build ,参数输入package

你可能感兴趣的:(工具方法)