Missing artifact com.epam.reportportal:agent-java-testng:jar:5.0.4 - pom.xml

While integrating the report portal with your testng project, we need epam.reportpotal dependencies, On adding the reportportal dependency I am facing the following error in pom.xml dependency :
it says : Missing artifact com.epam.reportportal:agent-java-testng:jar:5.0.4

To resolve this you need to add the following repositories in your pom.xml file as mentioned on github(https://github.com/reportportal/agent-java-testNG)
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-epam-reportportal</id>
<name>bintray</name>
<url>http://dl.bintray.com/epam/reportportal</url>
</repository>
</repositories>

Related

Peculiar Maven Repository Resolution Problem

I am facing a strange phenomena related to Maven repository resolution (Maven version: 3.8.4) which I am unable to explain. The matter is as follows:
We have a internal Nexus proxy setup for Central Repository. The URL is http://[companyDomain]:8081/repository/maven-central
I am declaring a repository in the pom.xml as follows:
<repository>
<id>nexus-maven-central</id>
<name>Maven Central Repository Internal Proxy</name>
<url>http://[companyDomain]:8081/repository/maven-central</url>
<layout>default</layout>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
The effective pom is showing the above repository as the first in the list of repositories and default Maven Central repository (id:central) after that as it should be.
However, when I build the pom, Maven is directly going to the Maven Central repository, not considering the above repository.
Now, when I start a Nexus instance in my local host and change the above URL to:
http://localhost:8081/repository/maven-central
Maven resolves the repository and downloads from the localhost.
Further, when I use the http://[companyDomain]:8081/repository/maven-central again in the pom and this time configure a mirror in the global setting.xml (I am not using user specific settings)
<mirror>
<id>nexus-maven-central-mirror</id>
<name>Mirror for Maven Central Repository</name>
<url>http://[companyDomain]:8081/repository/maven-central</url>
<mirrorOf>central</mirrorOf>
</mirror>
Maven perfectly resolves the internal proxy repository and downloads artifacts.
As for the environment, I am connecting to the corporate network through a VPN. IP of the internal Nexus server is resolvable when I am connected to the VPN; there are no VPN outages when I am trying the above.
I was expecting Maven to at least try the internal proxy repo when configured with the 'downloading from ...' message, nothing of that nature shows up in the console. It goes directly to Central Repository.
I further tested with the following URLs:
http://repo1.maven.org/maven2/ ---> Does Not Work
https://repo1.maven.org/maven2/ ---> Works
While I am aware that Maven does not prefer to download from 'http' and Maven Central explicitly states that it will send error if accessed over http, then the question is why is it downloading from localhost on http and not remote; does Maven have this behaviour of ignoring remote http.
Or are the 'localhost' and remote repos treated differently by Maven. Or are there some other matter I am missing.
I, unfortunately could not unearth much documentation on the above; any help would be appreciated.
The first thing is: I am declaring a repository in the pom.xml as follows:
If you use a repository manager always define the repositories via the settings.xml like this:
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>https://central</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://central</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
Remove all repository entries from your pom files...

Create local remote repository using Maven

I am using Maven for build and Jenkins for CI/CD. For production, need to keep all my Maven build jars in my remote repository, I am adding my local repository by
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<url>http://10.16.70.55:9001/var/lib/jenkins/.m2/repository</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>snapshots</id>
<name>Archiva Managed Snapshot Repository</name>
<url>http://10.16.70.55:9001/var/lib/jenkins/.m2/repository</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Is this the correct way? Does Jenkins provide remote repository? Is there any other tools which we can use?
Have you looked at using an actual repository manager tool like Nexus OSS or JFrog Artifactory ?

How to get the list of jars downloaded from a specific repository out of many defined in pom.xml

I have the following repositories defined in my pom.xml.
<repositories>
<repository>
<id>spring-maven-release</id>
<name>Spring Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
</repository>
<repository>
<id>spring-maven-milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
</repository>
<repository>
<id>spring-roo-repository</id>
<name>Spring Roo Repository</name>
<url>http://spring-roo-repository.springsource.org/release</url>
</repository>
<repository>
<id>xxxx-repo.snapshot</id>
<name>iGV Snapshot Repository</name>
<url>http://mavenrepo.XXXX.com/maven2</url>
</repository>
Is there a way to know the jars that are downloaded from http://mavenrepo.XXXX.com/maven2 in the above pom.xml?
Yes you can check by following steps:
Right click on project explorer folder n click on new.
Click on others,select maven new project.
Click next,choose default work-space.
Now you can see list of archetypes these are nothing but dependencies that comes with maven.

SpatialRepository in Embedded Neo4j

Can someone answer this question. Is it possible to have the spatial repository in a spring boot app in embedded mode?
#Bean
public GraphDatabaseService graphDatabaseService() {
return new GraphDatabaseFactory().newEmbeddedDatabase("neo4j.db");
}
by just adding the
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-spatial</artifactId>
<version>0.9</version>
</dependency>
to your classpath?
I keep getting the error
Caused by: java.lang.IllegalArgumentException: No index provider 'spatial' found. Maybe the intended provider (or one more of its dependencies) aren't on the classpath or it failed to load.
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:91)
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.findIndexConfig(IndexManagerImpl.java:142)
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.getOrCreateIndexConfig(IndexManagerImpl.java:209)
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.getOrCreateNodeIndex(IndexManagerImpl.java:314)
at org.neo4j.kernel.impl.coreapi.IndexManagerImpl.forNodes(IndexManagerImpl.java:302)
at org.springframework.data.neo4j.support.DelegatingGraphDatabase.createIndex(DelegatingGraphDatabase.java:163)
at org.springframework.data.neo4j.support.index.IndexProviderImpl.createIndex(IndexProviderImpl.java:91)
at org.springframework.data.neo4j.support.index.IndexProviderImpl.getIndex(IndexProviderImpl.java:68)
at org.springframework.data.neo4j.support.index.IndexProviderImpl.getIndex(IndexProviderImpl.java:108)
at org.springframework.data.neo4j.support.mapping.EntityIndexCreator$2.doWithPersistentProperty(EntityIndexCreator.java:61)
at org.springframework.data.neo4j.support.mapping.EntityIndexCreator$2.doWithPersistentProperty(EntityIndexCreator.java:57)
at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:294)
at org.springframework.data.neo4j.support.mapping.EntityIndexCreator.ensureEntityIndexes(EntityIndexCreator.java:57)
at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.updateStoredEntityType(Neo4jMappingContext.java:78)
at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:71)
at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:49)
at org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:257)
at org.springframework.data.mapping.context.AbstractMappingContext.initialize(AbstractMappingContext.java:373)
at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.initialize(Neo4jMappingContext.java:111)
at org.springframework.data.mapping.context.AbstractMappingContext.afterPropertiesSet(AbstractMappingContext.java:363)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
... 62 more
Sure, you can have spring data neo4j + spring boot.
You can find the code I wrote here: https://github.com/inserpio/neo4art
And a short post describing how I did it: https://inserpio.wordpress.com/2014/09/21/neo4art-moves-to-cloud-foundry-at-springone-2gx-2014/
Hope it can help!
Cheers,
Lorenzo
Use this repository in your maven pom
<repository>
<id>neo4j-contrib-releases</id>
<url>https://raw.github.com/neo4j-contrib/m2/master/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>neo4j-contrib-snapshots</id>
<url>https://raw.github.com/neo4j-contrib/m2/master/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
with the dependency
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-spatial</artifactId>
<version>0.13-neo4j-2.1.2</version>
</dependency>

Maven cannot for life download maven-plugin-descriptor-2.0.6

Basic info:
I use embedded Maven 3.0.4 in Eclipse Juno (with JBoss Tools).
settings.xml (straight from community.jboss.org/wiki/MavenGettingStarted-Users):
<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>
<activeProfiles>
<activeProfile>jboss-public-repository</activeProfile>
<activeProfile>jboss-deprecated-repository</activeProfile>
</activeProfiles>
Note: I tried also repository.jboss.org/nexus/content/groups/jboss and repository.jboss.org/nexus/content/groups/public/ with same results.
What I did:
I created Maven project from scrath using artifact org.jboss.spec.archetypes jboss-javaee6-webapp. System try to download repos. Everything downloads fine except two POMs:
maven-plugin-descriptor-2.0.6.pom
plexus-2.0.2.pom
I will focus on maven-plugin-descriptor, but plexus behave identically.
Error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project example:
Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved:
Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 ():
Failed to read artifact descriptor for org.apache.maven:maven-plugin-descriptor:jar:2.0.6:
Could not transfer artifact org.apache.maven:maven-plugin-descriptor:pom:2.0.6 from/to central (repo.maven.apache.org/maven2):
No response received after 60000 -> [Help 1]
Requested file is not present at all in repository.jboss.org/nexus/content/groups/public-jboss/org/apache/maven/maven-plugin-descriptor/2.0.6/ (returns 404).
I tried to go to repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.0.6/ directly in browser. File maven-plugin-descriptor-2.0.6.pom is present, but after click it thinks... thinks... thinks... aaand connection reset. Note that many other POMs was downloaded from repo.maven.apache.org without problems. Only this file for some reason Just Don't Work(TM).
Other:
I am NOT behind proxy. I DID use "delete whatever.lastUpdated" trick. Even deleted entire repo to force downloading everything again. Did not work, of course.
Any ideas? Or maybe I am barking at wrong tree and some other repository must be set in settings.xml? I have impression that maven tries to download too old versions...
Problem was solved. If someone have similiar problem to mine, he have to use mirrors.
In settings.xml:
<settings>
...
<mirrors>
<mirror>
<id>uk.maven.org</id>
<mirrorOf>central</mirrorOf>
<name>UK Central</name>
<url>http://uk.maven.org/maven2</url>
</mirror>
</mirrors>
...
</settings>

Resources