Missing artifact for apache-drill - maven-3

I am following documentation. As metioned there, I used the following dependency:
<dependency>
<groupId>org.apache.drill.exec</groupId>
<artifactId>drill-java-exec</artifactId>
<version>1.0.0</version>
</dependency>
While building maven project, I got an error:
Missing artifact org.apache.drill.exec:drill-java-exec:jar:1.0.0
How to resolve this?

In the maven central repository, I only see version 1.1.0 not 1.0.0
<dependency>
<groupId>org.apache.drill.exec</groupId>
<artifactId>drill-java-exec</artifactId>
<version>1.1.0</version>
</dependency>
Maybe you need to change your version.

Drill's artifacts are not in maven central, so install them from your local Drill installation:
mvn install:install-file -Dfile=/opt/apache-drill-1.0.0/jars/drill-java-exec-1.0.0-rebuffed.jar -DgroupId=org.apache.drill.exec -DartifactId=drill-java-exec -Dversion=1.0.0 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=/opt/apache-drill-1.0.0/jars/drill-common-1.0.0-rebuffed.jar -DgroupId=org.apache.drill -DartifactId=drill-common -Dversion=1.0.0 -Dpackaging=jar -DgeneratePom=true

Related

Version management in Maven

I have two different projects. Project_1 is a maven multi-module project. Project_2 depends on some modules of the Project_2. I have declared a version property in parent POM of Project_1 and referred in the child POM like below.
Project_1 Parent POM
<groupid>x</groupid>
<artifactid>y</artifactid>
<version>${app.version}</version>
<properties>
<app.version>1.0.0</app.version>
</properties>
Project_1 Child POM
<parent>
<groupid>x</groupid>
<artifactid>y</artifactid>
<version>${app.version}</version>
</parent>
<artifactid>y1</artifactid>
Project_2 POM
<dependency>
<groupid>x</groupid>
<artifactid>y</artifactid>
<groupid>1.0.0</groupid>
</dependency>
I have installed Project_1 using "mvn clean install" in the local repository but the problem is Project_1 and its module pom and its dependencies installed in the local repo is with version ${app.version}. Due to this, If I refer the Project_1 or its modules as a dependency in Project_2 with the actual version 1.0.0, its throwing error that it can't find version 1.0.0
Is there any way to solve this? during install of Project_1, I like to override the key {app.version} with actual in the local repo.
The same can be achieved by flatten-maven-plugin.
In case of Parent version include, flatten-maven-plugin can be used with xml-maven-plugin.

Getting ClassNotFoundException in Grails 2.5.6

Migrating from 1.3.7 to 2.5.6
java.lang.ClassNotFoundException: org.codehaus.groovy.grails.project.compiler.GrailsProjectCompiler how can we fix this?
Trying to build project using goal grails:clean grails:war -Dmaven.skip.test=true
Grails Version : 2.5.6
Java version 1.7
As stated by the comments, you're in for quite a ride to get this up and running.
This particular error is probably because you are missing the new dependencies needed for Grails. This is what you need if you have a maven project which I assume you have while getting this problem:
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-dependencies</artifactId>
<version>${grails.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-test</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-plugin-testing</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>
You also have to remove all of the old dependencies to the 1.3 grails core. In 1.3 it was a series of dependencies if I don't remember incorrectly.
If it is not a maven project you should get this for free by specifying the inerits("global") in your BuildConfig.groovy:
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to
}
...
That said, this will not be the last of your problems while upgrading. I have successfully managed to upgrade some small projects but it has taken quite an effort. For larger projects, I would seriously consider if it is worth it.
My best advice if you decide to go through with it is to generate a new empty 2.5.6 project and compare settings and dependencies to your legacy project.

Error as "The type org.hamcrest.Matcher cannot be resolved

I am getting error as
The type org.hamcrest.Matcher cannot be resolved. It is indirectly referenced from required .class files
for Rest Assured Api Testing .
Download the hamcrest jar from the below link and place the jar in project build path.
https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all/1.3
This resolved the above issue for me.
I also had same issue with java project but then I have created a maven project and added below dependencies:
<dependencies>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.3.3</version>
<scope>test</scope>
</dependency>`
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-path</artifactId>
<version>4.3.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-schema-validator</artifactId>
<version>4.3.3</version>
<scope>test</scope>
</dependency>
<dependencies>
and imported below lib:
import io.restassured.RestAssured;
import static io.restassured.RestAssured.*;
so, it got resolved. But same for java project, Rest Assured 4.3.3 jar not working.
First make sure you have made all the recommended static imports.
Next, 'assertThat()' requires parameters. And RestAssured provides convenience methods so you actually don't need to use it for common asserts. So try rewriting your then() to something like:
then().
statusCode(200).
contentType(ContentType.JSON);
Download the jar from below link and place it in project build path
https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all/1.3
This worked for me.
Still, you facing the issue
Add this Jar in Build path ->modulerpath
Add this jar
https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all/1.3
And the issue will be resolved.
Open pom.xml file and delete the line test from all the dependencies. This resolved the above issue for me.
Open pom.xml file and delete the line test from all the dependencies. This resolved the above issue for me.

Dataflow fails with java.lang.NoSuchMethodError: io.grpc.protobuf.ProtoUtils.marshaller(Lcom/google/protobuf/Message;)

I'm trying to get a Dataflow job to run on Google Cloud. It always fails with:
java.lang.NoSuchMethodError: io.grpc.protobuf.ProtoUtils.marshaller(Lcom/google/protobuf/Message;)Lio/grpc/MethodDescriptor$Marshaller
It's a maven project, here are my dependencies:
<dependencies>
<dependency>
<groupId>com.google.cloud.dataflow</groupId>
<artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>0.4.0</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
I've tried a bunch of different dependency versions. What am I missing?
It has the same result whether I run via exec:java or via a shade jar.
Full stack trace:
(e8dbd0c1b8b8a22): java.lang.NoSuchMethodError:
io.grpc.protobuf.ProtoUtils.marshaller(Lcom/google/protobuf/Message;)Lio/grpc/MethodDescriptor$Marshaller;
at com.google.iam.v1.IAMPolicyGrpc.(IAMPolicyGrpc.java:56) at
com.google.cloud.pubsub.spi.v1.PublisherSettings$Builder.(PublisherSettings.java:487)
at
com.google.cloud.pubsub.spi.v1.PublisherSettings$Builder.createDefault(PublisherSettings.java:508)
at
com.google.cloud.pubsub.spi.v1.PublisherSettings$Builder.access$000(PublisherSettings.java:402)
at
com.google.cloud.pubsub.spi.v1.PublisherSettings.defaultBuilder(PublisherSettings.java:224)
at
com.google.cloud.pubsub.spi.DefaultPubSubRpc.(DefaultPubSubRpc.java:138)
at
com.google.cloud.pubsub.PubSubOptions$DefaultPubSubRpcFactory.create(PubSubOptions.java:60)
at
com.google.cloud.pubsub.PubSubOptions$DefaultPubSubRpcFactory.create(PubSubOptions.java:54)
at com.google.cloud.ServiceOptions.rpc(ServiceOptions.java:399) at
com.google.cloud.pubsub.PubSubImpl.(PubSubImpl.java:115) at
com.google.cloud.pubsub.PubSubOptions$DefaultPubSubFactory.create(PubSubOptions.java:43)
at
com.google.cloud.pubsub.PubSubOptions$DefaultPubSubFactory.create(PubSubOptions.java:38)
at com.google.cloud.ServiceOptions.service(ServiceOptions.java:391) at
com.google.lindsaysmith.titan.DataflowBulkLoadNodes$SendPubSub.sendPubsubMessage(DataflowBulkLoadNodes.java:41)
at
com.google.lindsaysmith.titan.DataflowBulkLoadNodes$SendPubSub.processElement(DataflowBulkLoadNodes.java:32)
at
com.google.cloud.dataflow.sdk.util.SimpleDoFnRunner.invokeProcessElement(SimpleDoFnRunner.java:49)
at
com.google.cloud.dataflow.sdk.util.DoFnRunnerBase.processElement(DoFnRunnerBase.java:139)
at
com.google.cloud.dataflow.sdk.runners.worker.SimpleParDoFn.processElement(SimpleParDoFn.java:190)
at
com.google.cloud.dataflow.sdk.runners.worker.ForwardingParDoFn.processElement(ForwardingParDoFn.java:42)
at
com.google.cloud.dataflow.sdk.runners.worker.DataflowWorkerLoggingParDoFn.processElement(DataflowWorkerLoggingParDoFn.java:47)
at
com.google.cloud.dataflow.sdk.util.common.worker.ParDoOperation.process(ParDoOperation.java:55)
at
The usual answer in this situation is that you really must use exactly the version of gRPC and Protocol Buffers declared in the dependencies of the Dataflow SDK. This includes all transitive dependencies, so you may have to suppress gRPC or protobuf dependencies of other libraries so they do not intefere.
You can see the versions here (gRPC) and here (protobuf). I'm leaving them out of this answer so it does not get out of date.

why axis-1.4.jar is dependent upon wsdl4j-1.5.1 jar file in maven

Container is already having wsdl4j-1.5.1.jar. I have observed that when I have written only
axis1.4 dependency code in my pom.xml, it automatically downloading axis-wsdl4j-1.5.1.jar file which is also
creating problem to my existing application. could you please let me know,
why axis jar is internally downloading wsdl file and how to remove this
internal dependency
Like we declare needed artifacts as maven dependencies in pom for our java project, artifacts(declared as dependencies) are also projects and need other artifacts(dependencies).
According to this url, artifact-axis-1.4.jar is using artifact-axis-wsdl4j-1.5.1.
That is why when you are trying to download the axis-1.4.jar, maven is automatically downloading its corresponding dependency - axis-wsdl4j-1.5.1.
If your container is providing wsdl jar then you can tell maven to not to download axis-wsdl4j-1.5.1.jar, by using the exclude tag in your pom file, like below -
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
<exclusions>
<exclusion>
<groupId>axis</groupId>
<artifactId>axis-wsdl4j</artifactId>
</exclusion>
</exclusions>
</dependency>
Above declaration should solve your jar clashing problem.
You can refer to this url suggested by Timo, to get the detailed explanation of exclude tag. *

Resources