拼图项目vs Maven [英] Project Jigsaw vs Maven
问题描述
来自拼图项目:
使开发人员更轻松地构建和维护库以及 适用于Java SE和EE平台的大型应用程序.
Make it easier for developers to construct and maintain libraries and large applications, for both the Java SE and EE Platforms.
我正在尝试了解什么是Jigsaw项目,到目前为止,似乎Jigsaw项目的目标与我们使用Maven(或Gradle)依赖项管理所做的工作有些重叠:
I'm trying to learn what project Jigsaw is and till now it seems that the goal of Project Jigsaw somewhat overlaps with what we did using Maven (or Gradle) dependency management:
- 构建像Maven这样的工具是否有威胁?
- 或者我的理解是错误的,而Jigsaw项目将以某种方式对这些构建工具进行补充?
推荐答案
非常简单的答案
拼图之后,public
仅在JAR范围内公开.要查看JAR之外的类,必须将其导出.
Very simplified answer
After Jigsaw, public
will be public only within the JAR scope. To see the class outside the JAR it must be exported.
Java将强制进行模块化,因为必须在module-info
文件中指定任何模块间的交互.
Java will force modularization because any inter module interaction will have to be specified in the module-info
file.
例如,如果生成一个WAR,它将几乎保持不变,但是WAR中的所有JAR程序包都必须定义一个模块信息(或者不定义它,而是将其视为自动或未命名的模块).
For example, if you produce a WAR it will remain almost unchanged but all JARs packages in the WAR must define a module-info (or not define it and be treated as automatic or unnamed modules).
Maven 具有2个主要功能:依赖关系管理和构建:
Maven has 2 main features: dependency management and building:
- 依赖管理意味着Maven可以确定库的版本 并从存储库中下载它们.
- 构建意味着Maven可以编译代码并将其打包为工件.
- Dependency management means Maven can determine versions of libraries and download them from repositiories.
- Building means Maven can compile code and package it into artifacts.
总结:Maven仍将负责构建,但是必须学习如何使用Jigsaw模块进行编译和打包.
To conclude: Maven will still be responsible for building, but one must learn how to compile and package using Jigsaw modules.
这篇关于拼图项目vs Maven的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!