neo4j.test: "package org.neo4j.test does not exist" error in maven - maven

I have small question: when I add dependency
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>1.8.1</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
to maven, I have error:
package org.neo4j.test does not exist
Why?
I didn't find "neo4j.test" in maven repository (http://search.maven.org/).
TIA.
Eugeny

If your actual code is underneath src/main/java, then the scope should not be test. Otherwise, please provide more details.

I don't use Maven but I copy the jar from http://m2.neo4j.org/content/groups/everything/org/neo4j/neo4j-kernel/1.8.1/neo4j-kernel-1.8.1-tests.jar

You need to use the classifier element:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>1.8.1</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
Some read: http://maven.apache.org/pom.html#Maven_Coordinates

Related

Maven issue verifying dependency : beam-sdks-java-io-google-cloud-platform

I need to integrate this dependency within my maven project:
<!-- https://mvnrepository.com/artifact/org.apache.beam/beam-sdks-java-io-google-cloud-platform -->
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-io-google-cloud-platform</artifactId>
<version>2.11.0</version>
</dependency>
However, when I try to execute the command mvn verify within my project I get the error attached:
thanks for the help!
Update
I have included my pubsub dependency like:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.69.0</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
</exclusion>
</exclusions>
</dependency>
The functions offered by Beam are not suitable for my project unfortunately.
What you are describing is the Diamond Dependency problem.
If you can use the same version of pubsub as beam you should not have this conflict. Per Maven Central, beam-sdks-java-io-google-cloud-platform depends on grpc-google-cloud-pubsub-v1 1.43.0.
I have figure it out the point is that I had on my pom.xml the dependency :
<!-- <dependency>-->
<!-- <groupId>com.google.cloud</groupId>-->
<!-- <artifactId>google-cloud-pubsub</artifactId>-->
<!-- <version>1.66.0</version>-->
<!-- </dependency>-->
But then how should I do if I need to work with these two dependencies on the same project?

Maven: 1.7.4 openejb dependancy fails

Wanted to make use of openejb on top of tomcat v7 using maven instead of installing tomee. Referring to Apache documentation, 3 dependencies have to be added to the maven project.
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0-6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-core</artifactId>
<version>4.7.4</version>
</dependency>
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>tomee</artifactId>
<version>1.7.4</version>
</dependency>
but the last depency generates following error: Missing artifact org.apache.openejb:tomee:jar:1.7.4
The correct artifactId being visible in:
http://mvnrepository.com/artifact/org.apache.openejb/apache-tomee/1.7.4
is apache-tomee and not tomee
so, replace the last depency by the following one and the problem will be solved:
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>apache-tomee</artifactId>
<version>1.7.4</version>
</dependency>

error: package org.jclouds.logging.slf4j.config does not exist ( the class SLF4JLoggingModule )

The import specified at the example http://www.jclouds.org/documentation/quickstart/openstack/ fails:
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
...
Iterable<Module> modules = ImmutableSet.<Module> of(new SLF4JLoggingModule());
The dependencies were added following the instruccions at http://www.jclouds.org/documentation/userguide/installation-guide/:
pom.xml:
...
<dependencies>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-allcompute</artifactId>
<version>1.5.7</version>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-allblobstore</artifactId>
<version>1.5.7</version>
</dependency>
</dependencies>
...
SOLUTION
1) Add the dependency of the artifact jclouds-slf4j (http://mvnrepository.com/artifact/org.jclouds.driver/jclouds-slf4j/1.5.4)
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-slf4j</artifactId>
<version>1.5.4</version>
</dependency>
2) Rebuild the project
The pom.xml may look like this:
...
<dependencies>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-allcompute</artifactId>
<version>1.5.7</version>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-allblobstore</artifactId>
<version>1.5.7</version>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-slf4j</artifactId>
<version>1.5.4</version>
</dependency>
</dependencies>
...
My bad. I wrote that doc.
The Get jclouds section on that page previously read
Follow the instructions for Getting the binaries using Apache Ant.
But only linked to the Installation guide at the top. It should have linked directly to the Getting the binaries using Apache Ant section which has the jclouds-slf4j driver in it.
I've added anchors to the Installation guide so you can link into individual sections now. Hope that helps clear it up.

Where can I find spring-ldap 1.3.1-RELEASE maven repo

1.2.1 is available, i can get it by
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap</artifactId>
<version>1.2.1</version>
</dependency>
but I can't get the latest build. I have used
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap</artifactId>
<version>1.3.1.RELEASE</version>
</dependency>
I am interested in using the authenticate method of LdapTemplate.
It looks like now they want you to declare dependencies on individual modules.
However, the single module is still there, but you need to use classifier to access it:
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap</artifactId>
<version>1.3.1.RELEASE</version>
<classifier>all</classifier>
</dependency>
It is available in the below link
You can download it here

How can I remove artifacts by Maven from the lib folder of the ear?

How can I remove artifacts from the lib folder of the ear? For exemple: activation.jar.
I was try follow the especification about Excluding a module (just change webModule for jarModule) but without success with this error: Artifact[jar:javax.activation:activation] is not a dependency of the project.
Use provided as scope wherever the dependency is defined.
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
Set the scope to provided. Maven will still add the dependency to the compile time classpath but not to the final WAR.
As others have said, you need to use provided as the scope. If the jars you need to remove are not dependencies of your project directly (ie are transient dependencies), then you need to exclude them from whatever is bringing them into your build . If you actually need those classes at compile-time, you'll have to re-include them as provided:
<dependency>
<!-- this dependency has javax.activation as a dependency -->
<groupId>blah.groupId</groupId>
<artifactId>blah.artifactId</artifactId>
<version>blah.version</version>
<exclusions>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<exclusion>
</exclusions>
</dependency>
<!-- only necessary if this jar is needed at compile-time -->
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>

Resources