jigsaw

Gradle: Building a modularized library that is compatible with Java 8

送分小仙女□ 提交于 2019-12-21 05:12:15
问题 So Java 9 is there, soon to be followed by Java 10. Time we should make our libraries ready for use in Java 9 projects. I did it in the following way: provide a module-info.java added the (experimental) jigsaw plugin in build.gradle Manually made changes according to the guide on the gradle site instead of using the jigsaw plugin. So far, both approaches work fine, and I can use the generated Jar in Java 9 projects. The problem is, the resulting Jar is not compatible with Java 8 although I

Java 9 Modules and JUnit 4

对着背影说爱祢 提交于 2019-12-21 04:56:18
问题 Eclipse oxygen; windows 7; JDK 9 final from 9, 21; JUnit 4.12 and an existing application. As starting point the application can be compiled, executed and all JUnit Tests shows green. Now we use eclipse to generate the file module-info.java. The outcome looks like: module ch.commcity.topsort { exports ch.commcity.topsort; requires junit; } But with the error: junit cannot be resolved to module. The question is: How to tell the file that junit does not define any module and it should be run in

cannot compile Java 9 module with --patch-module in IntelliJ IDEA 2017.2.1

扶醉桌前 提交于 2019-12-20 17:27:00
问题 I am trying to acquaint myself with Java 9 modules and how to define them in IntelliJ. Among other things, I want to solve a split package problem using the --patch-module compiler/JVM flag and I don't know how to make it work in IntelliJ. I am using IntelliJ IDEA 2017.2.1 Build #IC 172.3544.35 with Java HotSpot(TM) 64-Bit Server VM (build 9+180, mixed mode). This is my source file MyImmutableList.java : package com.google.common.collect; public class MyImmutableList extends

cannot compile Java 9 module with --patch-module in IntelliJ IDEA 2017.2.1

巧了我就是萌 提交于 2019-12-20 17:26:32
问题 I am trying to acquaint myself with Java 9 modules and how to define them in IntelliJ. Among other things, I want to solve a split package problem using the --patch-module compiler/JVM flag and I don't know how to make it work in IntelliJ. I am using IntelliJ IDEA 2017.2.1 Build #IC 172.3544.35 with Java HotSpot(TM) 64-Bit Server VM (build 9+180, mixed mode). This is my source file MyImmutableList.java : package com.google.common.collect; public class MyImmutableList extends

Mix --class-path and --module-path in javac (JDK 9)

 ̄綄美尐妖づ 提交于 2019-12-19 04:46:07
问题 I tried to follow this question but it does`t work for me. I want to compile 1 module (which does not requires any other module or jar) together with other classes which use this module and will be in unnamed module. javac -cp lib\* --module-path modules --add-modules simpleModule -d out @classes.txt After I run this command I get " package org.... does not exist". But jar with this package is in lib directory lib - directory with my libraries-jars modules - this folder contains module

Missing dependencies when generate-module-info jdeps

℡╲_俬逩灬. 提交于 2019-12-17 20:17:35
问题 I`m trying to run jdeps with the following command: jdeps --module-path modules --generate-module-info out com.demo.market.jar My com.demo.market.jar depends both on application modules and automatic modules. I put all dependencies in the 'modules' folder but I got an error: Error: missing dependencies com.demo.market.platform.MarketPlace -> com.demo.client.wholesale.Client not found com.demo.market.platform.MarketPlace -> com.demo.product.api.Product not found com.demo.market.platform

Where should I put unit tests when migrating a Java 8 project to Jigsaw

天大地大妈咪最大 提交于 2019-12-17 11:45:07
问题 I am currently testing to migrate a Java 8 application to Java 9 / Jigsaw, using jdk-9+149. The project has been laid out in standard Maven directory layout, i.e. having src/main/java , src/test/java , etc. As soon as I add the module-info.java to src/main/java , maven-compiler-plugin fails throwing a NullPointerException. This is because it expects to find a module-info for the test directory, too. So, as far as I can see, the options are: keep test classes in a separate module, which means

阿里巴巴微服务架构演进

半世苍凉 提交于 2019-12-15 19:59:15
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 阿里巴巴服务化架构演进 单一应用架构 All In One 整个网站几个应用 前台 web + 后台 ops + tasks 业务 web + service/dao 各自开发 一起集成发布 技术战:Webx、Spring Ibatis、Jboss、Oracle 存在的问题:合并时经常代码冲突、发布相互制约效率低下、应用代码庞大臃肿维护困难。 垂直应用架构 按应用拆分 Service / DAO / Impl 都以二方库 jar 包的形式提供出去 代码拆分,独立部署,流程隔离,技术栈没有太大变化 应用相互之间直接依赖二方库 问题: 升级困难,要全网推动 数据库连接池压力大 分布式服务架构 API 与实现分离 使用 RPC 进行通信,服务端升级方便 各种服务中心出现,会员中心,商品中心,交易中心等 技术栈: Ali-tomcat Pandora Dubbo HSF 存在的问题: 依赖冲突 中间件升级困难 应用配置服务 应用开发效率低下 微服务架构 拥抱微服务,提升开发体验和效率 应用更轻量、开发更简单 配置 编码 开发 调试 部署 技术栈: Pandora Boot Spring Boot 容器隔离Pandora 为什么需要隔离? Pandora的容器架构如下: Pandora 结构与部署形式: 与应用 tgz

JaCoCo and MR Jars

雨燕双飞 提交于 2019-12-14 00:24:05
问题 There is an issue with JaCoCo and the MultiRelease JAR files. Since the same class name exist on two places, JaCoCo complains: Caused by: java.lang.IllegalStateException: Can't add different class with same name: jodd/core/JavaBridge at org.jacoco.core.analysis.CoverageBuilder.visitCoverage(CoverageBuilder.java:107) at org.jacoco.core.analysis.Analyzer$1.visitEnd(Analyzer.java:96) How we can tell JaCoCo (in Gradle) to skip the classes from META-INF path? OR to behave like it should (use

How to use log4j with maven and java9 in Eclipse Oxygen?

∥☆過路亽.° 提交于 2019-12-12 08:16:07
问题 I try to migrate a Java8 project to Java9. The auto generated module-info.java contains an entry requires log4j; and an error is shown: log4j cannot be resolved to a module => How do I correctly include log4j as a module dependency with Java9? (I have the same issue for following dependencies: requires hibernate.core; requires hibernate.jpa.2.1.api; requires jcommander; requires junit; requires reflections; ) What I did so far: Installed Java 9.0.1 Upgraded Eclipse to Oxygen.1a Release (4.7