jfinal_cms-v5.1.0 审计前缀
0x0 Maven 简介Maven是由Apache软件基金会开发的跨平台项目管理工具软件基于Apache License 2.0协议发布需JDK 8运行环境最新版本为2023年6月29日发布的3.9.3版。该工具起源于Jakarta Turbine项目的构建标准化需求名称取自意第绪语“知识的积累”旨在解决Ant构建脚本差异化及JAR文件共享问题 [1] [4] [7]。Maven通过项目对象模型(POM)实现项目构建、依赖管理和文档生成提供标准化的生命周期流程clean/default/site及常用命令如mvn compile、mvn install等操作。其采用集中式信息管理机制通过预定义构建规则简化项目配置支持本地仓库依赖共享核心功能包括构建生命周期定义、插件系统扩展及自动化依赖下载 [1] [5-6] [9]。该工具被广泛应用于Apache Jakarta项目及企业级Java项目开发支持多模块项目管理其3.x版本在保持与Maven 2向后兼容性的基础上优化了性能与可用性类似于php的composer0x1 依赖解析在 XML 中前缀是指标签名中冒号前面的部分例如 xsi:schemaLocation 中的 xsi。如果标签名没有冒号就是“没有前缀的标签”。在你的 pom.xml 里绝大多数标签如 groupId、artifactId、version都没有前缀。这是因为根元素 project 通过 xmlnshttp://maven.apache.org/POM/4.0.0 设置了默认命名空间意思是所有不带前缀的标签都属于这个 Maven POM 命名空间它们遵循 Maven 定义的规范。而像 xsi:schemaLocation 这样的标签带有前缀 xsi它是通过 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance 声明的另一个命名空间专门用于 XML Schema 实例相关的属性如提供模式位置。简单说· 没有前缀的标签 → 属于 Maven POM 标准是 Maven 认识的核心配置如项目坐标、依赖。· 有前缀的标签 → 属于其他命名空间通常用于辅助功能如校验、扩展属性。这种设计让 XML 可以在同一个文档中混合多个不同“词汇表”而不会互相冲突。!-- 根元素声明此文件是 Maven 项目描述符指定命名空间和模式位置 -- !-- xmlnshttp://maven.apache.org/POM/4.0.0 这行定义了默认命名空间。 · 命名空间就是给标签加上一个“归属标识”防止不同 XML 格式里的同名标签比如 name冲突。 · 这个网址看起来像链接但它其实只是一个唯一标识符告诉别人这个文件里所有没有前缀的标签如 groupId都是 Maven POM 规范中定义的标签。 · 好比说“这辆车是按照国家汽车标准制造的”那个标准编号就是命名空间。-- !-- xsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd 前半部分 http://maven.apache.org/POM/4.0.0 是命名空间。 · 后半部分 http://maven.apache.org/maven-v4_0_0.xsd 是一个实际可访问的 XSD 文件它就像是“说明书”里面详细描述了哪些标签可以写、标签的先后顺序、数据类型等。 · IDE 或 Maven 会读取这个说明书来校验你的 pom.xml 格式是否正确并提供代码提示。-- project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd !-- · modelVersion4.0.0/modelVersion 声明当前 POM 模型版本。对于 Maven 2 及 3这个值必须是 4.0.0表示使用该版本的 POM 规范。 · groupIdcom.jflyfox/groupId 组织标识通常采用反向域名的方式确保全局唯一。它代表项目所属的组织或团队例如 com.jflyfox 对应域名 jflyfox.com。 · artifactIdjfinal_cms/artifactId 项目标识在 groupId 范围内唯一。通常与项目名称一致例如这里的 jfinal_cms 表示 JFinal CMS 项目。 · packagingwar/packaging 打包方式默认为 jar。war 表示最终输出为 Web 应用归档文件.war可部署到 Servlet 容器如 Tomcat。其他常见值有 pom父项目、jarJava 库。 · version5.1.0/version 项目版本号通常遵循语义化版本如 主版本.次版本.修订版。Maven 根据版本号处理依赖的版本管理和升级。 这四者groupId、artifactId、version加上可选的 packaging共同构成 Maven 的项目坐标用于在仓库中唯一标识该项目及其构建产物。在依赖声明中正是通过这三个核心坐标来引用其他构件。 方便别人引用告诉Maven你是谁是之前传上去了这是个标签。 -- modelVersion4.0.0/modelVersion groupIdcom.jflyfox/groupId artifactIdjfinal_cms/artifactId packagingwar/packaging version5.1.0/version !-- 控制行为 -- !-- properties自定义属性-- properties !-- 文件拷贝时的编码 -- project.build.sourceEncodingUTF-8/project.build.sourceEncoding project.reporting.outputEncodingUTF-8/project.reporting.outputEncoding !-- 编译时的编码 -- maven.compiler.encodingUTF-8/maven.compiler.encoding !-- 阿里连接池 -- druid.version1.1.20/druid.version !-- jfinal -- jfinal.version4.7/jfinal.version !-- mysql -- mysql.version8.0.18/mysql.version !-- beetl -- beetl.version3.0.13.RELEASE/beetl.version !-- fastjson -- fastjson.version1.2.62/fastjson.version /properties 引用 dependencies依赖标签 dependencies dependency 来自组织 groupIdcom.jfinal/groupId 项目名 artifactIdjfinal/artifactId 版本号 version${jfinal.version}/version /dependency dependency groupIdcom.jfinal/groupId artifactIdjfinal/artifactId version${jfinal.version}/version classifiersources/classifier /dependency !-- dependency groupIdc3p0/groupId artifactIdc3p0/artifactId version0.9.1.2/version /dependency-- dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version2.5/version scopeprovided/scope /dependency dependency groupIdjavax.servlet.jsp/groupId artifactIdjsp-api/artifactId version2.2/version scopeprovided/scope /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.16/version /dependency dependency groupIdcommons-fileupload/groupId artifactIdcommons-fileupload/artifactId version1.3.1/version /dependency dependency groupIdde.ruedigermoeller/groupId artifactIdfst/artifactId version1.58/version /dependency dependency groupIdnet.sf.ehcache/groupId artifactIdehcache/artifactId version2.7.5/version scopeprovided/scope /dependency dependency groupIdredis.clients/groupId artifactIdjedis/artifactId version2.9.0/version /dependency dependency groupIddom4j/groupId artifactIddom4j/artifactId version1.6.1/version /dependency dependency groupIdcommons-io/groupId artifactIdcommons-io/artifactId version2.4/version /dependency dependency groupIdcom.alibaba/groupId artifactIdfastjson/artifactId version${fastjson.version}/version /dependency dependency groupIdde.ruedigermoeller/groupId artifactIdfst/artifactId version1.58/version 排除配置排除子依赖 exclusions exclusion groupIdorg.javassist/groupId artifactIdjavassist/artifactId /exclusion /exclusions /dependency dependency groupIddom4j/groupId artifactIddom4j/artifactId version1.6.1/version exclusions exclusion groupIdxml-apis/groupId artifactIdxml-apis/artifactId /exclusion /exclusions /dependency dependency groupIdcom.jfinal/groupId artifactIdcos/artifactId version26Dec2008/version /dependency !-- aliyun oss -- dependency groupIdcom.aliyun.oss/groupId artifactIdaliyun-sdk-oss/artifactId version2.0.6/version /dependency dependency groupIdcom.ibeetl/groupId artifactIdbeetl/artifactId version${beetl.version}/version /dependency !-- dependency groupIdorg.antlr/groupId artifactIdantlr4-runtime/artifactId version4.2/version /dependency-- dependency groupIdcom.alibaba/groupId artifactIddruid/artifactId version${druid.version}/version /dependency !-- 数据库 -- dependency groupIdmysql/groupId artifactIdmysql-connector-java/artifactId version${mysql.version}/version /dependency /dependencies !-- 使用aliyun maven -- repositories repository idaliyun/id namealiyun/name 远程下载 urlhttp://maven.aliyun.com/nexus/content/groups/public/url /repository /repositories 如何打包目录映射 build !-- 打包目录 -- directorytarget/directory !-- 打包名称 -- finalName${project.artifactId}/finalName plugins plugin artifactIdmaven-compiler-plugin/artifactId configuration source1.8/source target1.8/target encodingUTF-8/encoding !-- java8 保留参数名编译参数 -- compilerArgument-parameters/compilerArgument /configuration /plugin plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId version2.6/version configuration failOnMissingWebXmlfalse/failOnMissingWebXml webResources resource targetPathWEB-INF/classes/targetPath directorysrc/main/resources/directory /resource /webResources /configuration /plugin plugin groupIdorg.mortbay.jetty/groupId artifactIdjetty-maven-plugin/artifactId version8.1.3.v20120416/version configuration stopPort9966/stopPort stopKeyfoo/stopKey scanIntervalSeconds0/scanIntervalSeconds connectors connector implementationorg.eclipse.jetty.server.nio.SelectChannelConnector port80/port maxIdleTime60000/maxIdleTime /connector /connectors webAppConfig contextPath/${project.artifactId}/contextPath /webAppConfig classesDirectory${basedir}/target/${project.artifactId}/classes/classesDirectory webAppSourceDirectory${basedir}/target/${project.artifactId}/webAppSourceDirectory /configuration /plugin plugin groupIdorg.codehaus.mojo/groupId artifactIdtomcat-maven-plugin/artifactId version1.1/version configuration port80/port path/${project.artifactId}/path !-- warSourceDirectory${basedir}/target/${project.artifactId}/warSourceDirectory-- /configuration /plugin /plugins /build /project0x2 报错//org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile 无法从仓库下载 //未能达成目标 //无法解析插件 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile (default-compile) on project jfinal_cms: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile failed: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.15.0 or one of its dependencies could not be resolved: //下载失败 //No PSK available. Unable to resume. 缺失密钥网络不稳定 [ERROR] Could not transfer artifact org.codehaus.plexus:plexus-compiler-manager:jar:2.16.2 from/to central (https://repo.maven.apache.org/maven2): No PSK available. Unable to resume. // [ERROR] Could not transfer artifact org.codehaus.plexus:plexus-compiler-javac:jar:2.16.2 from/to central (https://repo.maven.apache.org/maven2): peer not authenticated [ERROR] //帮助 [ERROR] - [Help 1] [ERROR] // [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. //如果想启用完整的调试日志显示每个步骤的详细信息可以加上 -X 参数重新运行。 [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: //提供了一个官方 Wiki 链接专门解释“插件解析异常”的常见原因和解决方法。 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException0x3 正确配置 Maven 全局镜像settings.xmlMaven 的 settings.xml 文件用于配置全局镜像、代理等。你需要找到或创建这个文件并添加阿里云镜像。1.找到 settings.xml 的位置全局配置Maven 安装目录下的 conf/settings.xml例如 D:\apache-maven-3.8.8\conf\settings.xml用户配置推荐C:\Users\你的用户名\.m2\settings.xml如果不存在新建一个project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd modelVersion4.0.0/modelVersion groupIdcom.jflyfox/groupId artifactIdjfinal_cms/artifactId packagingwar/packaging version5.1.0/version properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding project.reporting.outputEncodingUTF-8/project.reporting.outputEncoding maven.compiler.encodingUTF-8/maven.compiler.encoding druid.version1.1.20/druid.version jfinal.version4.7/jfinal.version mysql.version5.1.49/mysql.version beetl.version3.0.13.RELEASE/beetl.version fastjson.version1.2.62/fastjson.version maven.compiler.plugin.version3.8.1/maven.compiler.plugin.version maven.surefire.plugin.version2.22.2/maven.surefire.plugin.version maven.resources.plugin.version3.1.0/maven.resources.plugin.version maven.war.plugin.version3.2.2/maven.war.plugin.version /properties dependencies !-- JFinal 核心及源码 -- dependency groupIdcom.jfinal/groupId artifactIdjfinal/artifactId version${jfinal.version}/version /dependency dependency groupIdcom.jfinal/groupId artifactIdjfinal/artifactId version${jfinal.version}/version classifiersources/classifier /dependency !-- Servlet JSP API -- dependency groupIdjavax.servlet/groupId artifactIdservlet-api/artifactId version2.5/version scopeprovided/scope /dependency dependency groupIdjavax.servlet.jsp/groupId artifactIdjsp-api/artifactId version2.2/version scopeprovided/scope /dependency !-- 日志 -- dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.16/version /dependency !-- 文件上传 -- dependency groupIdcommons-fileupload/groupId artifactIdcommons-fileupload/artifactId version1.3.1/version /dependency dependency groupIdcommons-io/groupId artifactIdcommons-io/artifactId version2.4/version /dependency dependency groupIdcom.jfinal/groupId artifactIdcos/artifactId version26Dec2008/version /dependency !-- 序列化 -- dependency groupIdde.ruedigermoeller/groupId artifactIdfst/artifactId version1.58/version exclusions exclusion groupIdorg.javassist/groupId artifactIdjavassist/artifactId /exclusion /exclusions /dependency !-- 缓存 -- dependency groupIdnet.sf.ehcache/groupId artifactIdehcache/artifactId version2.7.5/version scopeprovided/scope /dependency dependency groupIdredis.clients/groupId artifactIdjedis/artifactId version2.9.0/version /dependency !-- XML 解析 -- dependency groupIddom4j/groupId artifactIddom4j/artifactId version1.6.1/version exclusions exclusion groupIdxml-apis/groupId artifactIdxml-apis/artifactId /exclusion /exclusions /dependency !-- JSON -- dependency groupIdcom.alibaba/groupId artifactIdfastjson/artifactId version${fastjson.version}/version /dependency !-- 阿里云 OSS -- dependency groupIdcom.aliyun.oss/groupId artifactIdaliyun-sdk-oss/artifactId version2.0.6/version /dependency !-- 模板引擎 -- dependency groupIdcom.ibeetl/groupId artifactIdbeetl/artifactId version${beetl.version}/version /dependency !-- 数据库连接池 -- dependency groupIdcom.alibaba/groupId artifactIddruid/artifactId version${druid.version}/version /dependency !-- MySQL 驱动 -- dependency groupIdmysql/groupId artifactIdmysql-connector-java/artifactId version${mysql.version}/version /dependency /dependencies repositories repository idaliyun/id namealiyun/name urlhttp://maven.aliyun.com/nexus/content/groups/public/url /repository /repositories build directorytarget/directory finalName${project.artifactId}/finalName plugins !-- 编译插件 -- plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId version${maven.compiler.plugin.version}/version configuration source1.8/source target1.8/target encodingUTF-8/encoding compilerArgument-parameters/compilerArgument /configuration /plugin !-- 资源插件确保编码 -- plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-resources-plugin/artifactId version${maven.resources.plugin.version}/version configuration encodingUTF-8/encoding /configuration /plugin !-- 测试插件指定稳定版本避免自动下载最新 -- plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId version${maven.surefire.plugin.version}/version /plugin !-- WAR 打包插件 -- plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId version${maven.war.plugin.version}/version configuration failOnMissingWebXmlfalse/failOnMissingWebXml webResources resource targetPathWEB-INF/classes/targetPath directorysrc/main/resources/directory /resource /webResources /configuration /plugin !-- Jetty 插件开发调试用 -- plugin groupIdorg.mortbay.jetty/groupId artifactIdjetty-maven-plugin/artifactId version8.1.3.v20120416/version configuration stopPort9966/stopPort stopKeyfoo/stopKey scanIntervalSeconds0/scanIntervalSeconds connectors connector implementationorg.eclipse.jetty.server.nio.SelectChannelConnector port80/port maxIdleTime60000/maxIdleTime /connector /connectors webAppConfig contextPath/${project.artifactId}/contextPath /webAppConfig classesDirectory${basedir}/target/${project.artifactId}/classes/classesDirectory webAppSourceDirectory${basedir}/target/${project.artifactId}/webAppSourceDirectory /configuration /plugin !-- Tomcat 插件可选 -- plugin groupIdorg.codehaus.mojo/groupId artifactIdtomcat-maven-plugin/artifactId version1.1/version configuration port80/port path/${project.artifactId}/path /configuration /plugin /plugins /build /project
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2432506.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!