服务器 打开网站iis7网站维护的内容有哪些

当前位置: 首页 > news >正文

服务器 打开网站iis7,网站维护的内容有哪些,功能型网站设计,搭网站要多少钱默认的情况下#xff0c;当直接执行maven项目的编译命令时#xff0c;对于结果来说是不打第三方包的#xff0c;只有一个单独的代码jar#xff0c;想要打一个包含其他资源的完整包就需要用到maven编译插件#xff0c;使用时分以下几种情况 第一种#xff1a;当只是想单纯…默认的情况下当直接执行maven项目的编译命令时对于结果来说是不打第三方包的只有一个单独的代码jar想要打一个包含其他资源的完整包就需要用到maven编译插件使用时分以下几种情况 第一种当只是想单纯的开发一个maven项目不涉及其他复杂的项目结构最后只需要一个全部资源可执行jar就用如下插件pom buildplugins!– Maven Assembly Plugin 是maven官方的编译打包插件–plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-assembly-plugin/artifactIdversion3.3.0/version!– 插件的配置参数相关–configuration!– 当你在打可执行包也就是结果包是一个jar时可以指定主类–archivemanifestmainClasscom.yourpackage.MainClass/mainClass !– 指定主类 –/manifest/archive!– 这里需要给一个结果包的后缀用来区分–descriptorRefsdescriptorRefjar-with-dependencies/descriptorRef/descriptorRefs/configuration!– 插件的执行阶段定义可以有多个不过一般一个打包的就够了 –executionsexecution!– 这个id是自定的保证有多个执行阶段的时候是唯一的就行 –idmake-assembly/id!– 这个执行阶段在maven的那个阶段生效这里绑定在打包时生效 –phasepackage/phase!– 这个single是固定的不用变意思是根据给定的或者默认的配置来执行编译默认时是打当前项目的所有dependencies为一个完整包这个参数不要过多纠结官方文档中也只有这个你要能力够可以自己封装 –goalsgoalsingle/goal/goals/execution/executions/plugin/plugins /build打包后项目的输出路径下除了原本的最小jar外会有一个包名包含jar-with-dependencies的jar 第二种assembly是一个比较好用的编译插件无论是单独打jar还是整个项目打归档类的包都能胜任不过早些年ssm那个时代Java常用的编译插件是compiler这个插件现在也有人用不过它在打包的时候常常出问题所以用它来打包的话保险起见要指定resources。同时它只能打jar包并且不能指定主类在ssm这种web开发使用到的比较多而 Spring boot之后官方提供了自己的编译插件再加上它没有assembly那么好用所以现在用的不多 buildplugins!– maven在进行一些编译操作所使用的插件 –plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdversion3.5.1/versionconfigurationsource1.8/sourcetarget1.8/targetencodingUTF-8/encoding/configuration/plugin/pluginsresourcesresourcedirectorysrc/main/java/directory!–所在的目录–includesinclude/*.properties/includeinclude/.xml/include/includesfilteringfalse/filtering/resourceresourcedirectorysrc/main/resources/directory!–所在的目录–includesinclude**/.xml/includeinclude*/.properties/include/includesfilteringfalse/filtering/resource/resources/build第三种在多数情况下项目结构比较复杂比如父子项目或者需要打一些其他特别的资源文件到结果包中又或者结果不止需要插件打默认的jar包因此除非是某个模块或者项目真的就只打一个简单的完整包会使用第一种编译方式外其他情况需要提供assembly完整的打包说明文件使用方式如下 首先在需要的项目pom中声明打包用的插件。这里注意一下一定要把所有需要打包的资源放在一个专门用来打包的子模块中因为这个插件没办法跨项目打资源总之我这边本地是尝试了之后没发现能跨模块打资源的方法最多能做到按照描述文件各打各的但是然并朊啊 buildpluginsplugin!– 插件和版本 –groupIdorg.apache.maven.plugins/groupIdartifactIdmaven-assembly-plugin/artifactIdversion3.3.0/version!– 这里需要给插件提供一个打包阶段的描述文件并且当你这样使用的时候第一种情况的主类和前缀配置就不要配了一来是大概率不生效二来这种给定描述文件的方式通常是用来打归档类结果文件的也就是tar这种而不是一个单一的可执行jar –configurationdescriptors!– \({project.basedir}是maven自带的变量可以获取当前项目的根路径 --descriptor\){project.basedir}/assembly.xml/descriptor/descriptors/configurationexecutionsexecutionidmake-assembly/idphasepackage/phasegoalsgoalsingle/goal/goals/execution/executions/plugin/plugins/build下面是描述文件的内容 assembly!– 设置结果集的id最后会作为结果文件名的后缀 –idbin/id!– 指定结果集的格式可以支持zip, tar, tar.gz等可以写多个结果就会有对应的多个 –formatsformattar.gz/format/formatsincludeBaseDirectorytrue/includeBaseDirectory!– 指定结果集中包含的文件集 –fileSetsfileSetdirectory\({project.basedir}/bin/directoryoutputDirectory/bin/outputDirectoryincludesinclude*/include/includesfileMode0644/fileMode/fileSet/fileSets!-- 指定程序集中包含的依赖项集这个一般使用的时候就是固定的格式 --dependencySetsdependencySet!-- 包含所有依赖项到lib --outputDirectory/lib/outputDirectory!-- 包含项目自身的jar --useProjectArtifacttrue/useProjectArtifact!-- 还可以指定依赖即便但是一般不写打全部的 scoperuntime/scope--/dependencySet/dependencySets/assembly上面这个文件内容是通常情况下的使用内容一般也够了但是描述文件中还有其他的标签可以用你可以在网上查它的约束消息下面一些可能会用到的标签大家参考一下就行了 assembly!-- 设置结果集的id最后会作为后缀 --idbin/id!-- 指定结果集的格式可以支持zip, tar, tar.gz等 --formatsformattar.gz/formatformatdir/format/formats!-- 在结果集中是否包含一个基本目录默认值是true就好比我们使用开源软件解压之后是个完整的目录而不是全部在当前目录解压所有文件 --includeBaseDirectorytrue/includeBaseDirectory!-- 设置生成程序集存档的基本目录名如果没有设置并且includeBaseDirectory为true则使用\){project.build.finalName}作为基本目录名一般都用默认的 –baseDirectory${project.build.finalName}/baseDirectory!– 在最终档案中是否包含一个站点目录默认值是false这个只有在特殊情况在可能用true –includeSiteDirectoryfalse/includeSiteDirectory!– 这个很少会用到它是用来让插件自动合并或定制一些文件比如多个properties文件聚合成一个有需要的话网上找找案例就行 –containerDescriptorHandlerscontainerDescriptorHandlerhandlerNamemetaInf-services/handlerNameconfiguration!– 配置选项具体根据需求填写 –/configuration/containerDescriptorHandler/containerDescriptorHandlers!– 指定包含在程序集中的模块文件这个也用的很少因为程序运行的jar一般会打到一个固定的路径下而且如果你的使用方式和我一样那么需要的资源就已经在一个专门编译用的子模块下了不会涉及到从其他模块里面再去指定 –moduleSetsmoduleSet!– 包含当前项目的所有模块 –useAllReactorProjectstrue/useAllReactorProjects!– 指定包含或排除的模块 –includesincludecom.example:my-module/include/includesexcludesexcludecom.example:excluded-module/exclude/excludes!– 设置输出目录 –outputDirectorymodules/outputDirectory/moduleSet/moduleSets!– 指定程序集中包含的文件集这个很长用 –fileSetsfileSetdirectorysrc/main/resources/directoryoutputDirectoryconf/outputDirectoryincludesinclude.xml/includeinclude.properties/include/includesfileMode0644/fileMode/fileSet/fileSets!– 指定程序集中包含的依赖项集 –dependencySetsdependencySet!– 包含所有依赖项 –outputDirectorylib/outputDirectoryscoperuntime/scope/dependencySet/dependencySets /assembly第四种情况Maven项目可以用来Java和Scala混编但是上面的maven-assembly-plugin编译不了scala文件所以需要用下面的两个插件配合一个是java的一个是scala的先编译最后统一用shade打包但是这种方式只能打可执行jar至于混编下打tar包 目前还没有遇到这种情况。 build!– 这里规定插件版本 –pluginManagementplugins!– 编译scala的插件 –plugingroupIdnet.alchim31.maven/groupIdartifactIdscala-maven-plugin/artifactIdversion3.2.2/version/plugin!– 编译java的插件 –plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdversion3.5.1/version/plugin/plugins/pluginManagementplugins!– 规定Scala怎么编译 注意这里只规定编译不规定打包–plugingroupIdnet.alchim31.maven/groupIdartifactIdscala-maven-plugin/artifactIdexecutions!– 这两个 Execution规定编译源码添加资源 第2个测试编译可以不要–executionidscala-compile-first/idphaseprocess-resources/phasegoalsgoaladd-source/goalgoalcompile/goal/goals/executionexecutionidscala-test-compile/idphaseprocess-test-resources/phasegoalsgoaltestCompile/goal/goals/execution/executions/plugin!– 这里是规定怎么编译java –plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdconfigurationsource1.8/sourcetarget1.8/targetencodingUTF-8/encoding/configurationexecutions!– 作用和上面的一样只不过这里不用显示的调用add来添加资源 –executionphasecompile/phasegoalsgoalcompile/goal/goals/execution/executions/plugin!– shade插件用来把上面的所有资源统一打包成一个新的jar –plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-shade-plugin/artifactIdversion2.4.3/versionexecutionsexecutionphasepackage/phasegoalsgoalshade/goal/goalsconfigurationtransformerstransformer implementationorg.apache.maven.plugins.shade.resource.ManifestResourceTransformermainClasscom.example.MainClass/mainClass !– 如果需要打包可执行jar可以在这里指定主类不过一般用不着和混编一般是应用在数据引擎或实时处理上的对应的引擎有主类的指定直接上传一个jar包就好 –/transformer/transformersfiltersfilter!– 打包所有的资源并过滤中间文件 –artifact:/artifactexcludesexcludeMETA-INF/.SF/excludeexcludeMETA-INF/.DSA/excludeexcludeMETA-INF/*.RSA/exclude/excludes/filter/filters/configuration/execution/executions/plugin/plugins/build第五种一般情况下需要自己找插件的就这上面几种情况市面上有些架构有自己的编译插件比如上面提到的springbootspringboot的编译插件相当简洁整个spring Boot框架能把能砍掉的繁杂配置步骤全砍了编译完会有两个结果用没有后缀的就行 plugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactIdconfigurationmainClasscom.example.bootweb.BootWebApplication/mainClass/configuration /plugin