maven

Where to put 3rd party libs when using Maven with Tomcat?

时光毁灭记忆、已成空白 提交于 2021-02-05 07:49:06
问题 I'm a new to Maven and I didn't find the proper answer to the following problem. For example I have libraries that my project depends on like: log4j, connector j, servlet api, junit, struts etc. When I'm using just Tomcat I can put this jars to %CATALINA_HOME%\lib folder and use them. But as Maven comes in I can configure pom.xml for all dependencies and their scopes. If I do it - can I remove libs from %CATALINA_HOME%\lib folder ? If I can then how Tomcat knows where to find this 3rd party

java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J

霸气de小男生 提交于 2021-02-05 07:14:51
问题 I'm getting this "java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J" error while using ServiceCredentials.fromStream() method. Anyone here faced this and know a fix? TIA <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>[title]</groupId> <artifactId

How to enable TLSv1.2 in java 7?

风格不统一 提交于 2021-02-05 07:10:27
问题 I'm trying to enable TSLv1.2 in my machine which has java 1.7 using the commands -mvn -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 install / mvn -Dhttps.protocols=TLSv1.2 install. But its throwing some errors saying my pom.xml has some unresolved dependencies, those dependencies errors are there because my project couldn't download from maven repository due to TSLv1.2 issue. Seems like a deadlock to me, Can anyone help me on how to resolve it? 回答1: You need to configure MAVEN_OPTS env variable or

Is it possible to include only the used classes in a war file with maven build?

岁酱吖の 提交于 2021-02-05 06:37:05
问题 Say I have this dependency in my pom.xml file: <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> </dependency> When I do a clean install all the javaee-api-6.0.jar will be included in the war file under WEB-INF\lib folder. Is it possible that instead of including the whole jar, only classes that I use and their dependencies are included? 回答1: If you're deploying into a Java EE application server, that entire JAR is already provided by the

Java 11 : Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile failed.: NullPointerException

放肆的年华 提交于 2021-02-04 19:51:29
问题 I am upgrading my project from java 8 to java 11. I'm able to build and deploy it with java11, spring 5 dependencies but when I am adding module-info.java into my project I am getting below error while build : [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project infrastructure: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile failed.: NullPointerException -> [Help 1] org.apache

EXCEPTION_ACCESS_VIOLATION in Jacob dll using VM in Jenkins pipeline

一世执手 提交于 2021-02-04 16:44:30
问题 We are going through a problem probably related to Jacob 1.14.3 dll when being used inside a Virtual Machine. When running our automation script from the jenkins pipeline inside our windows server VMs (master/slaves) the following error is shown in the logs: A fatal error has been detected by the Java Runtime Environment: EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180012df1, pid=6404, tid=0x00000000000017bc JRE version: Java(TM) SE Runtime Environment (8.0_271-b09) (build 1.8.0

Generate Maven archetype from Java code

非 Y 不嫁゛ 提交于 2021-02-04 16:15:42
问题 I want to know if it's possible to run the maven command: archetype:generate in Java code. I've tried this with the maven embedder, but this library is deprecated. I want to do an archetype:generate from a remote catalog, and capture the required properties of the archetype. The maven command I want to run is for example: mvn archetype:generate \ -DgroupId=com.maven \ -DartifactId=test \ -DarchetypeVersion=1.0-alpha-4 \ -DarchetypeGroupId=org.apache.maven.archetypes \ -DarchetypeArtifactId

Error compiling Java/Scala mixed project and Lombok

╄→гoц情女王★ 提交于 2021-02-04 13:24:25
问题 I am trying to compile a Maven Java/Scala mixed project that has a Scala class that depends on a Java bean with lombok annotations. I tried adding the lombok jar file to the boot classpath of the Scala compiler as well as the lombok agent, but the compiler still failed to find the generated getters. Is there a way for the Scala compiler to recognize the lombok annotations? If not, what would be a good workaround? Pease note that I am trying to avoid introducing another maven project just for

DatabaseType not found for product name: [Impala]

一个人想着一个人 提交于 2021-02-04 08:31:06
问题 While trying to setup a Spring boot - spring batch project, I am running into an error stating: DatabaseType not found for product name: [Impala] Full stack trace is as follows: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurer': Invocation of init method failed; nested exception is org.springframework.batch.core.configuration.BatchConfigurationException: java.lang.IllegalArgumentException: DatabaseType not found for product name: [Impala] at

Maven插件之versions-maven-plugin

北战南征 提交于 2021-02-04 08:27:35
转载: https://blog.csdn.net/u012260238/article/details/107841294 2020博客地址汇总 2019年博客汇总 很多 Maven 用户遇到过这样一个问题,当项目包含大量模块的时候,为他们集体更新版本就变成一件烦人的事情,到底有没有自动化工具能帮助完成这件事情呢?(当然你可以使用 sed 之类的文本操作工具,不过不在本文讨论范围)答案是肯定的,versions-maven- plugin 提供了很多目标帮助你管理 Maven 项目的各种版本信息。例如最常用的,命令 mvn versions:set -DnewVersion=1.1-SNAPSHOT 就能帮助你把所有模块的版本更新到 1.1-SNAPSHOT。该插件还提供了其他一些很有用的目标,display-dependency- updates 能告诉你项目依赖有哪些可用的更新;类似的 display-plugin-updates 能告诉你可用的插件更新;然后 use- latest-versions 能自动帮你将所有依赖升级到最新版本。最后,如果你对所做的更改满意,则可以使用 mvn versions:commit 提交,不满意的话也可以使用 mvn versions:revert进行撤销。 步骤1:找到依赖包,并且引入到项目中 <build> <plugins>