Maven Failing download the JBoss dependency - maven-2

Below are my maven settings from behind the proxy
User Settings:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:\path\mvn_repo</localRepository>
<pluginGroups></pluginGroups>
<proxies>
<proxy>
<active>true</active>
<protocol>https</protocol>
<username>myusername</username>
<password>password</password>
<host>myproxyhost</host>
<port>myproxyport</port>
</proxy>
<proxy>
<active>true</active>
<protocol>http</protocol>
<username>myusername</username>
<password>password</password>
<host>myproxyhost</host>
<port>myproxyport</port>
</proxy>
</proxies>
<servers></servers>
<mirrors></mirrors>
<profiles></profiles>
</settings>
Global Settings:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>D:\path\mvn_repo</localRepository>
<pluginGroups></pluginGroups>
<proxies></proxies>
<servers></servers>
<mirrors></mirrors>
<profiles>
<profile>
<id>jboss-public-repository</id>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
</settings>
However I get 'Connection timed out' when I try to execute test goal.
This happens with both maven command line and M2Eclipse. What more settings do I require.

Maybe the proxy you are using requires NTLM authentication, which maven does not support.
You can try to use CNTLM:
http://cntlm.sourceforge.net/

JBoss repository has been moved in June 2011 causing many other users to experience problems like you describe. Most likely you need to change the URL in your pom.
For more details, refer to
How to configure jboss repository properly for my repository manager
and other answers listed as "Related" to above
JBoss wiki for maven users: Maven Getting Started - Users
PS. When doing the change, make sure to check all your poms that contain repository blocks because otherwise, broken JBoss URL may slip through these and kill your build

Related

hive-warehouse-connector_2.11 + Required field 'client_protocol' is unset

I am using a hadoop cluster with cloudera-6.3.2 distribution.
I have a requirement to read hive ACID table from spark (Java client). So native spark does not read hive acid table. Hence planning to use Hive WareHouse Connector. But getting below exceptions.Even could not read non acid table also. Any Thoughts?
20/03/27 21:26:46 INFO HiveWarehouseSessionImpl: Created a new HWC session: 9f46ffe3-c863-4fbf-82ef-9f730f0c0cfc
20/03/27 21:26:47 INFO LlapBaseInputFormat: Handle ID 6439738b-a20a-46cc-9ee3-63214b573660: query=select * from test
20/03/27 21:26:47 ERROR HiveConnection: Error opening session
org.apache.thrift.TApplicationException: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{set:hiveconf:hive.server2.thrift.resultset.default.fetch.size=1000, use:database=default/})
at org.apache.thrift.TApplicationException.read(TApplicationException.java:111)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:79)
Java Code
HiveWarehouseSession hive = HiveWarehouseSession.session(spark).build();
hive.executeQuery("select * from test").show();
Here is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fw_analytics</groupId>
<artifactId>com.analytics</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.4.0-cdh6.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-hive_2.11</artifactId>
<version>2.4.0-cdh6.3.2</version>
</dependency>
<dependency>
<groupId>com.hortonworks.hive</groupId>
<artifactId>hive-warehouse-connector_2.11</artifactId>
<version>1.0.0.7.0.3.0-79</version>
</dependency>
</dependencies>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>hortonworks.extrepo</id>
<name>Hortonworks HDP</name>
<url>http://repo.hortonworks.com/content/repositories/releases</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>Cloudera.extrepo</id>
<name>Cloudera HDP</name>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>hortonworks.other</id>
<name>Hortonworks Other Dependencies</name>
<url>http://repo.hortonworks.com/content/groups/public</url>
</repository>
</repositories>
</project>

How to resolve project library via own mvn repository (artifactory)

How can I link an maven repository that we set up internally with my Intellij?
In the project libraries view, I am able to add a new project library that resides in the standard maven reppositories but I do not see how to point IntelliJ to a specifiy maven repository, for example the artifactory that we set up for the company.
Settings.xml is also not recognized by Intellij. I post the settings.xml afterwards, it's not recognized though (password, username and company name have been replaced) :
<settings>
<servers>
<server>
<username>USER</username>
<password>PW</password>
<id>central</id>
</server>
</servers>
<mirrors>
<mirror>
<mirrorOf>*</mirrorOf>
<url>
https://dev.mycompany.com:8443/artifactory/any
</url>
<id>central</id>
</mirror>
</mirrors>
<profiles>
<profile>
<repositories>
<repository>
<snapshots />
<id>central</id>
<url>
https://dev.mycompany.com:8443/artifactory/libs
</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots />
<id>central</id>
<url>
https://dev.mycompany.com:8443/artifactory/plugins
</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
IntelliJ uses repositories from pom.xml for your maven project and settings.xml, your maven configuration file. In order to get dependencies from repote repository and by not adding pom.xml, I believe you should define repository in settings file.
By default, this file is located in your home folder like {home}/.m2/settings.xml
Try add this configuration:
<settings>
...
<profiles>
...
<profile>
<id>myprofile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>my-repo2</id>
<name>your custom repo</name>
<url>http://jarsm2.dyndns.dk</url>
</repository>
</repositories>
</profile>
...
</profiles>
<activeProfiles>
<activeProfile>myprofile</activeProfile>
</activeProfiles>
...
</settings>
Also remember that you should either use profile while using maven or make it active by default. See more information here

EclipseLink Maven Repository not working correctly?

I'm trying to get the EclipseLink libraries from the given Maven repositories.
I read the tips given in Where did the EclipseLink/Maven repository go to? on stackoverflow and tried to integrate the Maven repositories posted there into my settings.xml.
I added those links to my settings.xml and also tried my pom.xml but when trying to update the indexes I only get
Resource nexus-maven-repository-index.properties does not exist
from all of them.
Here's what I've configured in my settings.xml
<repositories>
<repository>
<id>eclipseLink</id>
<name>eclipseLink</name>
<url>http://www.gtlib.gatech.edu/pub/eclipse/rt/eclipselink/maven.repo/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
<repository>
<id>EclipseLink Repo</id>
<name>eclipseLink</name>
<url>http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
<repository>
<id>Eclipse 3</id>
<name>eclipseLink</name>
<url>http://eclipse.ialto.org/rt/eclipselink/maven.repo/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
I'm using the m2eclipse plugin for Eclipse to integrate the dependencies.
It seemed to me that in the Question mentioned above someone else is having the same issue in 2011, but it's not answered there.
Thanks for your help in advance.
I'm no maven, but I think the reason for this is that the repo is unindexed.
If you know what artifact you want, you can get it - but there's no index.

What repositories do you put in a generic pom file?

I am building a generic parent pom file for my projects.
In that file, I would like to have a list of most common Maven repositories, in order to have most dependencies available in the sub-projects (Jboss, Spring, etc.).
Here is this current pom:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.courtine</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<name>Parent</name>
<version>1.0</version>
<description>Common repositories</description>
<repositories>
<repository>
<id>javanet</id>
<name>Repository for Maven2</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>google</id>
<name>Google repository for Maven2</name>
<url>https://oss.sonatype.org/content/repositories/google-releases/</url>
</repository>
<repository>
<id>jboss</id>
<name>JBoss repository for Maven2</name>
<url>http://repository.jboss.org/maven2/</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/release</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.external</id>
<name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/external</url>
</repository>
</repositories>
</project>
Is such a generic file listing common repositories a good idea?
Do you know other common public Maven repositories to put in such a generic pom file?
It is not a good idea to put repositories into a pom. Better use a Repository Manager like Nexus, Artifactory or Archiva.
In such kind of pom you should put things like default plugins with their appropriate revisions (pluginManagement) or dependencies which should be used (dependencyManagement).
Take a look for explanation into this. and take a look here how to setup this.
I have another option for doing what you want to do. You could using a profile in your settings.xml which reference all your repository for you (as an nexus/archiva will do).
I've posted something about his on my site.
Simply add this in your settings.xml:
<profile>
<id>my-repository</id>
<activation>
<!-- here we did not activat this profile by default -->
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<!-- list of standard repository -->
<repository>
<id>javanet</id>
<name>Repository for Maven2</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>google</id>
<name>Google repository for Maven2</name>
<url>https://oss.sonatype.org/content/repositories/google-releases/</url>
</repository>
<repository>
<id>jboss</id>
<name>JBoss repository for Maven2</name>
<url>http://repository.jboss.org/maven2/</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/release</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.external</id>
<name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/external</url>
</repository>
<repository>
<id>intelligents-ia</id>
<name>Intelligents-ia Repository</name>
<url>http://intelligents-ia.com/maven2</url>
</repository>
</repositories>
</profile>
And you could build your project by adding -Pmy-repository on the command line:
mvn -Pmy-repository clean install
Or activate this profile by default by setting true on :
<activation>
<activeByDefault>true</activeByDefault>
</activation>

m2eclipse Indexing 3rd-party jars from Maven repository

I am using Nexus repository. and using Eclipse 3.4 with m2eclipse plugin installed. sometimes I need to upload jars that are not located in the central repositories (Like Sun jars). so I upload them under the "3rd-Party" section in Nexus.
The problem is that when trying to add those jars as dependencies, eclipse does not index them and therefore they are not offered as options.
Any ideas,
Thanks,
Ronen.
I use third party jars in my project using Nexus and I am able to see them with the m2eclipse plugin by doing the following:
Right click on project --> Maven -->
Update Dependencies
Also, it may be important to note that I defined the following in my pom.xml as well (not in settings.xml).
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>public</id>
<name>Maven 2 Repository (Releases)</name>
<url>http://your.domain.com/nexus/content/groups/public</url>
<layout>default</layout>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
<id>public-snapshots</id>
<name>Maven 2 Repository (Snapshots)</name>
<url>http://your.domain.com/nexus/content/groups/public-snapshots</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>public</id>
<name>Maven 2 Repository (Releases)</name>
<url>http://your.domain.com/nexus/content/groups/public</url>
<layout>default</layout>
</pluginRepository>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
<id>public-snapshots</id>
<name>Maven 2 Repository (Snapshots)</name>
<url>http://your.domain.com/nexus/content/groups/public-snapshots</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
settings.xml is simpler:
<mirror>
<id>public</id>
<url>http://yourserver/nexus-webapp-1.5.0/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>