https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html
I've installed latest jdbc jar into my local mvn repo. While i'm trying to build my project I'm getting below error.
Failed to collect dependencies at Athena:AthenaJDBC42:jar:2.0.14.1000: Failed to read artifact descriptor for Athena:AthenaJDBC42:jar:2.0.14.1000: 1 problem was encountered while building the effective model for Athena:AthenaJDBC${env.JDBC_V}:${env.MAJOR_V}.${env.MINOR_V}.${env.REVISION_V}.${env.BUILD_V}
[ERROR] [ERROR] 'artifactId' with value 'AthenaJDBC${env.JDBC_V}' does not match a valid id pattern. #
Anyone have any idea, how to resolve this error.?
It is difficult to say with just the small Maven error snippet, but it looks like Maven doesn't recognize the property ${env.JDBC_V} or it contains some invalid value like a space.
I recommend to generate a Maven effective pom model (mvn help~effective-pom) and execute Maven in debug mode (mvn -X ...) to try to troubleshoot the cause.
I was facing the same error. It got resolved when I installed jar into repository using following command. (Ensure you deleted all existing instances of athena drivers jar files from .m2 before executing command)
mvn install:install-file -Dfile=/Users/chetanparekh/Downloads/AthenaJDBC42_2.0.14.jar -DgroupId=Athena -DartifactId=AthenaJDBC42 -Dversion=2.0.14.1000 -Dpackaging=jar
Snippet from my POM.
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<sharedLibraries>
<sharedLibrary>
<groupId>Athena</groupId>
<artifactId>AthenaJDBC42</artifactId>
</sharedLibrary>
</sharedLibraries>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>Athena</groupId>
<artifactId>AthenaJDBC42</artifactId>
<version>2.0.14.1000</version>
</dependency>
</dependencies>
Thank you for your answer.
I finally resolved it using
mvn install:install-file -Dfile=/Users/dk/Downloads/AthenaJDBC42_2.0.14.jar -DgroupId=Athena -DartifactId=AthenaJDBC42 -Dversion=2.0.14
Removed the build version(1000) and -Dpackaing=jar, it worked. I'm not sure what could be the problem with build version .1000 and -Dpacking=jar.
Thanks Again.!
Related
I have a project_1 which is using JAR of project_2.
project_2 is using the spring framework.
project_2 builds successfully but project_1 fails with below error using 'mvn clean install' command:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.4:repackage on project : xxx
: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.5.4:repackage failed:
Plugin org.springframework.boot:spring:boot-maven-plugin:2.5.4 or one of its dependencies could not be resolved.
Failed to read artifact descriptor for org.springframework.boot:spring-boot-buildpack-platform:jar2.5.4 Could not transfer artifact org.springframework.boot:spring-boot-buildpack-platform:pom:2.5.4 from artifact repository: Failed to transfer file http://repo.xxx.com/repo/org/springframework/boot/spring-boot-builpack-platform-2.5.4 with status code 308
I tried below command on project_1
" mvn clean install -U"
but it does not help.
One more thing I noticed:
Project_1 has following lines
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
and If I comment above plugin everything works perfectly.
But do not know if commenting it is a good idea or not.
I've forked Confluent's Kafka Connect HDFS writer and now I'd like to deploy a version of this jar to my local Nexus.
mvn clean deploy Works like a charm and deploys the jar.
https://[nexus]/repository/releases/io/confluent/kafka-connect-hdfs/5.0.0/kafka-connect-hdfs-5.0.0.jar
So far so good, but to make a distinction between the confluent versions and my own deployment I'd like to change the version of the build to something like 5.0.0-1 or so (preferably the tag name when pushed, but that's step 2)
The pom.xml is basically the same as the 5.0.0-post release, but here the most important parts:
<parent>
<groupId>io.confluent</groupId>
<artifactId>kafka-connect-storage-common-parent</artifactId>
<version>5.0.0</version>
</parent>
<artifactId>kafka-connect-hdfs</artifactId>
<packaging>jar</packaging>
<name>kafka-connect-hdfs</name>
<organization>
<name>Confluent, Inc.</name>
<url>http://confluent.io</url>
</organization>
<url>http://confluent.io</url>
<description>
A Kafka Connect HDFS connector for copying data between Kafka and Hadoop HDFS.
</description>
...
<dependencies>
...
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-connect-storage-common</artifactId>
<version>${confluent.version}</version>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-connect-storage-core</artifactId>
<version>${confluent.version}</version>
</dependency>
...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.confluent</groupId>
<version>0.10.0</version>
<artifactId>kafka-connect-maven-plugin</artifactId>
...
So first I added <version> tags to the pom.xml, but it started using that as the default for all confluent.version and complained that it couldn't find for example: https://[nexus]/repository/releases/io/confluent/kafka-connect-storage-hive/5.0.0-1/kafka-connect-storage-hive-5.0.0-1.pom
Next I tried the versions plugin from maven
mvn versions:set -DnewVersion=5.0.0-1 clean deploy
But that complained about the parent:
[ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.7:set (default-cli) on project kafka-connect-hdfs: Project version is inherited from parent. -> [Help 1]
I don't even care if the version is 5.0.0 in the code, I just wat to deploy to a different version in our artifactory.
I'm not a maven expert, so maybe I'm missing some very basic clue, but all help is welcome.
So there were some good suggestions, but in the end the one thing that worked best for me in our setup was to use the deploy:deploy-file command for maven.
mvn deploy:deploy-file \
-Dfile=target/kafka-connect-hdfs-5.0.0.jar \
-DrepositoryId=[nexus id] \
-Durl=[nexus url] \
-Dversion=$TAG \
-DgroupId=io.confluent \
-DartifactId=kafka-connect-hdfs
The major downside was that I had to respecify parameters that were already present in the pom.xml (artifactId, groupId, ect), but it works, and that's what counts :-)
You can specify the version with ${revision} parameter.
To do this, you need to add <version> tag with this variable in pom.xml:
<artifactId>kafka-connect-hdfs</artifactId>
<version>5.0.0-${revision}</version>
<packaging>jar</packaging>
And then provide it to the maven command. E.g.,
mvn clean package -Drevision=01 will generate kafka-connect-hdfs-5.0.0-01.jar file.
I'm trying to use mvn install, but I keep getting this error
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project example-module-core: Compilation failure: Compilation failure:
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/util/InitServlet.java:[10,47] package org.springframework.web.context.support does not exist
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/DatabaseServiceImpl.java:[9,50] package org.springframework.transaction.annotation does not exist
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/DatabaseServiceImpl.java:[22,2] cannot find symbol
[ERROR] symbol: class Transactional
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/InitializerServiceImpl.java:[11,50] package org.springframework.transaction.annotation does not exist
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/InitializerServiceImpl.java:[28,2] cannot find symbol
[ERROR] symbol: class Transactional
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/example-module-core/src/main/java/com/mycompany/project/module/util/InitServlet.java:[25,11] cannot find symbol
[ERROR] symbol: variable SpringBeanAutowiringSupport
[ERROR] location: class com.mycompany.SIAR.module.util.InitServlet
[ERROR] -> [Help 1]
In my InitServlet.java I have all the imports, and it has no errors. In the pom.xml I have all dependencies needed, but this problem always persists.
All the other solutions tell me to add the dependency and use Maven Update, but it is definitely not missing code/dependencies, because this project is being shared with 2 other users, and it works fine on the other machines. It is the exact same project.
I had this working for a few hours, after countless tries of mvn clean install, one of them got the BUILD SUCCESS and I didn't change anything, and it was working fine. But later, after changing some java files, I used mvn clean install, and got again the same error.
Any ideias of what it might be?
Thanks in advance.
I fixed it. Apparently it really needed 2 more dependencies on a pom.xml that was on another folder. I needed to add to a pom.xml that was in a core folder, these 2 dependencies.
<dependency>
<groupId>org.terasoluna.plus.framework</groupId>
<artifactId>terasoluna-plus-web-conf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
After adding it, I ran mvn clean install, and it installed successfully. Thank you anyway for all your help.
At time when it is working on other systems with exact pom , and not working on mine, I look into differences....
In my local repository - Delete the problematic dependency and run mvn clean install. Whatever dependencies are needed will be downloaded again by maven.
In my maven settings.xml - at the location ${MAVEN_HOME}/conf.What is the difference , did I over-ride any settings?
Difference in JDK version or Maven version.
I hope this helps.
you need to add maven-compiler-plugin into pom.xml. you can find the plugin code below and replace the source version by your jdk version:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source> // jdk version
<target>1.8</target> // jdk version
</configuration>
</plugin>
I'm having problems when I run mvn release:prepare. I have the following message:
[ERROR] Failed to execute goal org.apache.maven.plugins: maven-release-plugin: 2.5.1: prepare (default-cli) on project marketplace-po
c: Failed to invoke Maven build. Error configuring command-line. Reason: Maven executable not found at: C: \ dev \ apache-maven-3.3.1 \
bin \ mvn.bat -> [Help 1]
As of version 3.3.X, Maven renamed mvn.bat to mvn.cmd. This is fixed in the maven-release-plugin version 2.5.2: MRELEASE-902
They suggest adding the following section in case the fixed plugin version is not picked up automatically:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
I just had same problem when running from eclipse, it resolved by making
copy of mvn.cmd to mvn.bat
And it worked for me.
I had the same problem too at using Maven 3.3.1 in Windows 8.1. I searched on it and found that mvn.bat moved to mvn.cmd. Still, I don't know how to solve it at the version. So, I downloaded Maven 3.2.5 and there was the mvn.bat file. And it worked for me.
Fixed, i had same problem with maven 3.5.0 instalation, so just copy mvn.cmd and rename it to mvn.bat at C:\Program Files\apache-maven-3.5.0\bin.
I'm using SonarQube 4.1.1 and have the following configuration in my pom.xml file:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>4.1.1</version>
</plugin>
</plugins>
</pluginManagement>
When I try to run sonar from the command line using the maven plugin I get:
[ERROR] Plugin org.codehaus.mojo:sonar-maven-plugin:4.1.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:sonar-maven-plugin:jar:4.1.1: Failure to find org.codehaus.mojo:sonar-maven-plugin:pom:4.1.1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
Anyone know how to fix this issue? Do I need to make some configuration changes?
In fact this configuration is not needed. Have you try to run an analysis without it? You should give a try if you haven't.
But if you really need to force the version of the sonar-maven-plugin, you should set it to 2.1 on Maven 3.
See http://docs.codehaus.org/display/SONAR/Analyzing+with+Maven for more details.
Regards
Try this:
mvn clean sonar:sonar -U
The -U flag means force update of dependencies.