maven

Java9模块化指南

人盡茶涼 提交于 2021-01-26 18:25:49
1. 概述 Java9在包之上引入了一个新的抽象级别,正式称为Java平台模块系统(JPMS),简称“模块”。 在本文中,我们将介绍新系统并讨论其各个方面。 2. 什么是模块? 首先,我们需要先了解模块是什么,然后才能了解如何使用它们。 模块是一组密切相关的包和资源以及一个新的模块描述符文件。 换句话说,它是一个“Java包的包”的抽象,允许我们使代码更加 可重用 。 2.1 Packages 模块中的包与我们自Java诞生以来一直使用的Java包是相同的。 当我们创建一个模块时,我们将代码内部组织在包中,就像我们以前对任何其他项目所做的那样。 除了组织我们的代码外,还使用包来确定哪些代码可以在 模块外部公开访问 。我们将在本文后面花更多的时间讨论这个问题。 2.2 Resources 每个模块负责其资源,如媒体或配置文件。 以前,我们将所有资源放在项目的根级别,并手动管理属于应用程序不同部分的资源。 通过模块,我们可以将所需的图像和XML文件与需要的模块一起发送,从而使我们的项目更 易于管理 。 2.3 模块描述符 创建模块时,我们会包含一个描述符文件,该文件定义了新模块的几个方面: Name–我们模块的名称 依赖项–此模块依赖的其他模块的列表 公共包–我们希望从模块外部访问的所有包的列表 提供的服务–我们可以提供其他模块可以使用的服务实现 已使用的服务

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile

大城市里の小女人 提交于 2021-01-26 11:30:31
完整的错误信息: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project xinghe-interaction: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [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: [ERROR] [Help 1] http://cwiki

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)

為{幸葍}努か 提交于 2021-01-26 10:35:58
问题描述:运行程序时遇到问题 官方帮助: Unlike many other errors, this exception is not generated by the Maven core itself but by a plugin. As a rule of thumb, plugins use this error to signal a failure of the build because there is something wrong with the dependencies or sources of a project, e.g. a compilation or a test failure. The concrete meaning of the exception depends on the plugin so please have a look at its documentation. The documentation for many common Maven plugins can be reached via our plugin index . 翻译: 与许多其他错误不同,此异常不是由Maven核心本身生成的,而是由插件生成的。 根据经验,插件使用此错误来表示构建失败,因为项目的依赖项或源代码存在问题,例如: 编译或测试失败

Maven can't find parent POM

元气小坏坏 提交于 2021-01-26 05:33:04
问题 I am trying to build a maven project, but I have encountered problem. pom has specified parent pom and maven can't find it. I actually have the parent pom, but I don't know where to place it or what should I do so maven knows about. I'm new to maven so sorry if my question is stupid. 回答1: If you have the parent pom, you could try installing it. When you run mvn install on a module the resulting artifact will be placed in your repository, so that it can be used from other modules. 回答2: I am

spring中那些让你爱不释手的代码技巧(续集)

淺唱寂寞╮ 提交于 2021-01-26 01:22:12
前言 上一篇文章《spring中这些能升华代码的技巧,可能会让你爱不释手》发表之后,受到了不少读者的好评,很多读者都在期待续集。今天非常高兴的通知大家,你们要的续集来了。本文继续总结我认为spring中还不错的知识点,希望对您有所帮助。 一. @Conditional的强大之处 不知道你们有没有遇到过这些问题: 某个功能需要根据项目中有没有某个jar判断是否开启该功能。 某个bean的实例化需要先判断另一个bean有没有实例化,再判断是否实例化自己。 某个功能是否开启,在配置文件中有个参数可以对它进行控制。 如果你有遇到过上述这些问题,那么恭喜你,本节内容非常适合你。 @ConditionalOnClass 问题1可以用@ConditionalOnClass注解解决,代码如下: public class A { } public class B { } @ConditionalOnClass(B.class) @Configuration public class TestConfiguration { @Bean public A a() { return new A(); } } 如果项目中存在B类,则会实例化A类。如果不存在B类,则不会实例化A类。 有人可能会问:不是判断有没有某个jar吗?怎么现在判断某个类了? ❝ 直接判断有没有该jar下的某个关键类更简单。 ❞

SpringBoot+Vue实现供销链管理系统,值得学习!

孤街浪徒 提交于 2021-01-25 10:22:22
点击 蓝色字 免费订阅, 每天收到这样的好信息 前言 : 最近有不少粉丝关注本公众号。并且我已经 成功开通了流量主同时会赚一点点广告费,我打算每个月把这部分钱拿出来给大家买点书刊,算是给大家一点福利吧。大家想买什么书扫描下方的加他拉你加群。最后,非常感谢大家的关注。 私活接单qq群:716817407 介绍 Finer进销存是一款面向中小企业的供销链管理系统,基于J2EE快速开发平台Jeecg-Boot开发,采用前后端分离架构:SpringBoot2.x,Ant Design&Vue,Mybatis-plus,Shiro,JWT。 项目基于十多年的中小企业管理经验,由ERP领域的资深专家设计;产品分为基础版、标准版、企业版三个版本,可适应不同的管控流程;对于灵活多样的个性化的管理需求,在Jeecg-Boot支撑下,利用其强大的代码生成器,无需写任何代码就可以快速实现大多功能,也可手工加入复杂的业务逻辑! 基础版:管结果,直接出入库,生成应收应付,进行收付款并核销 标准版:管过程,业务从合同、申请、订单开始 企业版:管协同,全过程跟踪管理,集成协同办公 本发布为基础版 功能模块 ┌─库存管理 │ ├─入库管理 │ │ ├─采购入库(自动生成采购应付) │ │ ├─采购退货出库(自动生成红字采购应付) │ │ ├─盘盈入库 │ │ ├─涨库入库 │ │ └─其他入库 │ ├─出库管理

Kubernetes Jenkins动态创建Slave

非 Y 不嫁゛ 提交于 2021-01-25 03:16:37
[TOC] 0、前言 首先,我们考虑个问题,为何需要jenkins slave?其实在生产环境中,如果用单master,除非你单机器的配置特别高并且构建次数不多情况下,可以不考虑使用slave,但是,在构建次数上百次并且jenkins master运行在kubernetes环境中,借助kubernetes的灵活性,强烈推荐使用slave,master负责自动创建Slave Pod,然后将任务推送给Slave Pod,任务执行完毕后,Slave Pod会自动被回收/销毁。 创建slave流程图: 1、Jenkins部署 jenkins交付进kubernetes 1.准备镜像文件 $ docker pull jenkins/jenkins:2.204.1 $ docker tag a3f949e5ebfd harbor.od.com/infra/jenkins:v2.204.1 $ docker push harbor.od.com/infra/jenkins:v2.204.1 2.资源配置文件 rbac $ vi /data/k8s-yaml/jenkins_slave/rbac.yaml apiVersion: v1 kind: ServiceAccount metadata: name: jenkins namespace: infra --- kind: ClusterRole

QQ突然关停这项功能,网友:爷青结

点点圈 提交于 2021-01-24 14:04:26
点击上方 " 编程技术圈 "关注, 星标或置顶一起成长 后台回复“ 大礼包 ”有惊喜礼包! 每日英文 There is a time in life that is full of uneasiness.We have no other choice but to face it. 生命中总有那么一段时光,充满不安,可是除了勇敢面对,我们别无选择。 每日掏心话 人生不是等价交换,凡事不要斤斤计较。无论在哪里,无论以什么样的状态,要做的就是以不变应万变。 来 自 :扩展迷EXTFANS | 责编:乐乐 编程技术圈(ID:study_tech) 第 1112 次推文 往日回顾: 又一起“删库”跑路:链家程序员怒删公司 9TB 数据,被判 7 年!网友:真惨~ 正文 多年来,腾讯在打造自家的社区类社交系统上,可以说费劲了心思。 说到腾讯的社区产品,那就不得不提到腾讯搜吧。腾讯搜吧于2006年1月推出,旨在抗衡百度贴吧等社区。 但好景不长,腾讯搜吧并未创造出任何亮眼的成绩,在2014年3月便停运了。 在腾讯搜吧停运后两个月,很快,腾讯又推出了兴趣部落。 兴趣部落,官方定义是基于兴趣公开的主题社区,类似于贴吧和微信公众号的结合体。 同时,兴趣部落基于手机QQ获得了强势曝光。QQ用户可以在兴趣部落里实现交流讨论、信息沉淀,也可加入相关联的QQ群进行实时聊天。

maven deploy into local repository

风流意气都作罢 提交于 2021-01-24 12:13:24
问题 Can somebody, please, point me to the way of how can I deploy artefacts into the local repository to test deploy scenario? The thing is that we use nexus as remote repository and I wonder if it is possible to deploy my artifacts with custom name and not with names which nexus provide for us. Thanks in advance! 回答1: Use the following command mvn install:install-file -Dfile=myfile.jar -DgroupId=com.example -DartifactId=myartifact -Dversion=0.1 -Dpackaging=jar myfile.jar is your artifact and the

Cucumber: Class not found com.example.runner.RunnerTest

删除回忆录丶 提交于 2021-01-24 11:47:29
问题 I have a maven project to run cucumber and selenium . The *.feature files are defined in the src/features , and the steps are defined in the src/test/java/com/example/steps . I have also defined a test runner class as below: package com.example.runner; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( features={"src/features"}, glue="com/example/steps") public class RunnerTest { } The problem is