I have converted my existing project from vaadin 7 to vaadin 8 successfully. There is no error in the project, but when I use mvn install to build the project. I am getting this error:- GWT Module com.vaadin.v7.Vaadin7WidgetSet not found in project sources or resources.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:51 min
[INFO] Finished at: 2017-12-19T12:31:15+05:30
[INFO] Final Memory: 94M/1007M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:8.0.6:compile (default) on project XXX: GWT Module com.vaadin.v7.Vaadin7WidgetSet not found in project sources or resources. -> [Help 1]
From here:
Check the following:
You have to replace the vaadin-server dependency with vaadin-compatibility-server.
If you are using the default widgetset (you are not compiling it by yourself):
Replace the vaadin-client-compiled dependency with vaadin-compatibility-client-compiled.
Add #Widgetset("com.vaadin.v7.Vaadin7WidgetSet") to your UI implementations.
If you are using a custom widgetset:
Replace the vaadin-client dependency with vaadin-compatibility-client.
Recompile it.
In your POM I see these lines:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>7.5.10</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
<version>7.5.10</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>7.5.10</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<version>7.5.10</version>
<exclusions>
<exclusion>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
This won't work, you can't include any version 7 components, servers, clients.
The only valid thing, is to use the v8-compatibility things.
Related
I'm attempting to display the full tree of dependencies for a project I'm working on using the maven-dependency-plugin version 3.1.2 from the command line, but the mvn dependency:tree goal (nor any of the other goals from the maven-dependency-plugin) is not showing the test dependencies. The documentation of the plugin (https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html) states that all scopes are included by default, so using the -Dscope=test shouldn't be necessary (but when adding this parameter, the output doesn't change).
I've run this with a clean .m2 repository, using no settings.xml file (to ensure that all artifacts are coming directly from repo.maven.apache.org).
I'm running using maven 3.6.2 on a linux environment (CentOS 7) and using Oracle Java 1.8.0_144
Here's my POM:
<?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>com.sw-eval</groupId>
<artifactId>cayenne-eval</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-server</artifactId>
<version>4.2.M2</version>
</dependency>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-di</artifactId>
<version>4.2.M2</version>
</dependency>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-dbsync</artifactId>
<version>4.2.M2</version>
</dependency>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-client</artifactId>
<version>4.2.M2</version>
</dependency>
</dependencies>
</project>
Here's the output I receive from running the command mvn dependency:tree:
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.sw-eval:cayenne-eval >----------------------
[INFO] Building cayenne-eval 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # cayenne-eval ---
[INFO] com.sw-eval:cayenne-eval:jar:1.0.0-SNAPSHOT
[INFO] +- org.apache.cayenne:cayenne-server:jar:4.2.M2:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- org.apache.cayenne:cayenne-di:jar:4.2.M2:compile
[INFO] +- org.apache.cayenne:cayenne-dbsync:jar:4.2.M2:compile
[INFO] | +- org.apache.cayenne:cayenne-project:jar:4.2.M2:compile
[INFO] | \- net.java.dev.inflector:inflector:jar:0.7.0:compile
[INFO] \- org.apache.cayenne:cayenne-client:jar:4.2.M2:compile
[INFO] +- com.caucho:hessian:jar:4.0.63:compile
[INFO] \- org.apache.cayenne:cayenne-rop-server:jar:4.2.M2:compile
[INFO] +- org.apache.cayenne:cayenne-web:jar:4.2.M2:compile
[INFO] \- org.slf4j:slf4j-simple:jar:1.7.25:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.951 s
[INFO] Finished at: 2020-11-25T08:53:17-07:00
[INFO] ------------------------------------------------------------------------
When referring to the cayenne-server pom, however, there are many dependencies marked as test which are not shown in the output (specifically, the following are direct dependencies of cayenne-server, see https://search.maven.org/artifact/org.apache.cayenne/cayenne-server/4.2.M2/jar):
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cayenne.build-tools</groupId>
<artifactId>cayenne-test-utilities</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mockrunner</groupId>
<artifactId>mockrunner-jdbc</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- this one have old Xerces dependency that clashes with JDK's one -->
<groupId>nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<scope>test</scope>
</dependency>
So, is there something that I'm missing that needs to be enabled to show these test-scoped dependencies, and / or is this a weird artifact unique to the cayenne-server dependency?
Thanks in advance!
Dependencies of scope test are not transitive.
The test dependencies of your dependencies are not part of your dependency tree. They are ignored by Maven.
I have a dependency and a few dependent projects.
In the pom of dependency project, I have this -
<properties>
<jackson-core.version>2.6.1</jackson-core.version>
<jackson-core-asl.version>1.9.13</jackson-core-asl.version>
<jackson.version>1.9.13</jackson.version>
<jackson-databind.version>2.6.1</jackson-databind.version>
</properties>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-core.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-core.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml</groupId>
<artifactId>jackson-module-hibernate</artifactId>
<version>${fasterxml.version} </version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>${jackson-core-asl.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind.version}</version>
</dependency>
</dependencies>
jackson-databind.version is set to 2.6.1. After building the dependency project, when I run clean install on one of these dependent projects, I am getting the following errors, with version lookup failing for jackson-databind jar version 1.9.13 -
[ERROR] Failed to execute goal on project project-app: Could not resolve dependencies for project com.something:project-app:jar:1.0.1-SNAPSHOT: Failed to collect dependencies at org.springframework.boot:spring-boot-starter-web:jar:1.2.5.RELEASE -> com.fasterxml.jackson.core:jackson-databind:jar:1.9.13: Failed to read artifact descriptor for com.fasterxml.jackson.core:jackson-databind:jar:1.9.13: Could not transfer artifact com.fasterxml.jackson.core:jackson-databind:pom:1.9.13 from/to nexus-releases-prepaid (https://project.com/repository/maven-snapshots): Failed to transfer https://project.com/repository/maven-snapshots/com/fasterxml/jackson/core/jackson-databind/1.9.13/jackson-databind-1.9.13.pom. Error code 400, Repository version policy: SNAPSHOT does not allow version: 1.9.13 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project project-app: Could not resolve dependencies for project com.project:project-app:jar:1.0.1-SNAPSHOT: Failed to collect dependencies at org.springframework.boot:spring-boot-starter-web:jar:1.2.5.RELEASE -> com.fasterxml.jackson.core:jackson-databind:jar:1.9.13
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:269)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:147)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:248)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:202)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.project:project-app:jar:1.0.1-SNAPSHOT: Failed to collect dependencies at org.springframework.boot:spring-boot-starter-web:jar:1.2.5.RELEASE -> com.fasterxml.jackson.core:jackson-databind:jar:1.9.13
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:178)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:243)
... 23 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at org.springframework.boot:spring-boot-starter-web:jar:1.2.5.RELEASE -> com.fasterxml.jackson.core:jackson-databind:jar:1.9.13
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:284)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:279)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:169)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.fasterxml.jackson.core:jackson-databind:jar:1.9.13
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:255)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:171)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:530)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:515)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:403)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:356)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process(DefaultDependencyCollector.java:344)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:498)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:451)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:356)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process(DefaultDependencyCollector.java:344)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:247)
... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.fasterxml.jackson.core:jackson-databind:pom:1.9.13 from/to nexus-releases-prepaid (https://project.com/repository/maven-snapshots): Failed to transfer https://project.com/repository/maven-snapshots/com/fasterxml/jackson/core/jackson-databind/1.9.13/jackson-databind-1.9.13.pom. Error code 400, Repository version policy: SNAPSHOT does not allow version: 1.9.13
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:423)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:225)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:202)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:240)
... 37 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.fasterxml.jackson.core:jackson-databind:pom:1.9.13 from/to nexus-releases-prepaid (https://project.com/repository/maven-snapshots): Failed to transfer https://project.com/repository/maven-snapshots/com/fasterxml/jackson/core/jackson-databind/1.9.13/jackson-databind-1.9.13.pom. Error code 400, Repository version policy: SNAPSHOT does not allow version: 1.9.13
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:856)
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:1)
at io.takari.aether.connector.AetherRepositoryConnector$GetTask.flush(AetherRepositoryConnector.java:630)
at io.takari.aether.connector.AetherRepositoryConnector.get(AetherRepositoryConnector.java:309)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:499)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:400)
... 40 more
Caused by: io.takari.aether.connector.TransferException: Failed to transfer https://project.com/repository/maven-snapshots/com/fasterxml/jackson/core/jackson-databind/1.9.13/jackson-databind-1.9.13.pom. Error code 400, Repository version policy: SNAPSHOT does not allow version: 1.9.13
at io.takari.aether.connector.AetherRepositoryConnector.handleResponseCode(AetherRepositoryConnector.java:372)
at io.takari.aether.connector.AetherRepositoryConnector.access$8(AetherRepositoryConnector.java:362)
at io.takari.aether.connector.AetherRepositoryConnector$GetTask.resumableGet(AetherRepositoryConnector.java:574)
at io.takari.aether.connector.AetherRepositoryConnector$GetTask.run(AetherRepositoryConnector.java:452)
at io.takari.aether.connector.AetherRepositoryConnector.get(AetherRepositoryConnector.java:303)
... 42 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
There is no 1.9.13 version defined with - jackson-databind. Version defined for jackson-databind is 2.6.1 and for jackson-mapper-asl is 1.9.13. It seems to be taking the version defined for the latter. I am not sure why it is associating this version.
Note - the repository from which the download is being attempted is defined in the settings.xml
Update
In the dependent project, also, which I am trying to compile, I have version specified as -
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.6.1</version>
</dependency>
Update 2
As per #Serg's comments, I did the following -
I added the exclusion against spring-boot-starter-web in both the dependency and the dependent project.
I reran clean install on both the projects as well. However, I am still seeing the attempt to download 1.9.13 even after adding the exclusions.
Update 3
Extract from output of mvn dependency:tree of dependency project -
[INFO] +- org.springframework.security.oauth:spring-security-oauth2:jar:2.3.6.RELEASE:compile
[INFO] | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.1:compile
Above is followed by BUILD SUCCESS
Output of dependent project
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building project-app 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://project.com/repository/maven-snapshots/com/fasterxml/jackson/core/jackson-databind/1.9.13/jackson-databind-1.9.13.pom
^MDownloading: https://project.com/repository/maven-snapshots/com/fasterxml/jackson/core/jackson-annotations/1.9.13/jackson-annotations-1.9.13.pom
^MDownloading: https://project.com/repository/maven-snapshots/com/fasterxml/jackson/core/jackson-core/1.9.13/jackson-core-1.9.13.pom
^M[WARNING] The POM for com.project:project-security:jar:1.0.1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.project:project-issuer:jar:1.0.1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.project:project-lend:jar:1.0.1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.project:project-bank:jar:1.0.1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.project:project-subscription:jar:1.0.1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.project:project-social:jar:1.0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.307 s
[INFO] Finished at: 2019-07-26T15:34:00+05:30
[INFO] Final Memory: 20M/316M
If you have jackson-databind then you don't need to import jackson-core as the former already includes the latter.
As you can see jackson-databind:2.6.1 contains jackson-core:2.9.9 while you are manually importing jackson-core:2.6.1 and therefore get version conflict.
More generally, run mnv dependency:tree to see all the dependencies and look for a duplicates, specially the ones with different versions.
EDIT
Also as I can see from the stacktrace you use spring-boot-starter-web of the older versions, which also contains jackson-databind.
If you want to use jackson-databind of newer versions, than Spring provides - make the exclusion
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</exclusion>
</exclusions>
</dependency>
Otherwise, remove your duplicates and use out-of-the-box Spring solutions.
But as I can see your spring version is quite old, so I'd advise excluding jackson as in the example above.
Available Jackson Databind versions from Maven Central
EDIT 2
To make this all work I believe it would be enough to
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml</groupId>
<artifactId>jackson-module-hibernate</artifactId>
<version>1.9.1</version>
</dependency>
The only thing I'm not sure about is jackson-module-hibernate as I have no practice in using it.
I followed a tutorial and get this dependency file in maven project in intelliJ IDEA 2018.3
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>kafka.sample.firstProject</groupId>
<artifactId>kafka-first-sample</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
<kafka.version>2.1.0</kafka.version>
</properties>
<build>
<plug
ins>
<!-- Maven Compiler Plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Apache Kafka Clients-->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.0.0</version>
</dependency>
<!-- Apache Kafka Streams-->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams</artifactId>
<version>2.0.0</version>
</dependency>
<!-- Apache Log4J2 binding for SLF4J -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.11.0</version>
</dependency>
<!-- JUnit5 Jupiter -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<!-- JUnit 5 Jupiter Engine -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<!-- JUnit 5 Jupiter Parameterized Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
but whenever i try to run my build it throws this:
Error:(3, 41) java: package org.apache.kafka.clients.producer does not
exist and so on ...
Even after trying to run maven build still the problem persist.
Believe it or not i have get stuck in this problem from last many days.
Edit:
As #Parsecer asked to show maven build log, i found that there is an error as well
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building kafka-first-sample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.329 s
[INFO] Finished at: 2019-02-20T09:10:30+05:00
[INFO] Final Memory: 7M/34M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): No such host is known (repo.maven.apache.org) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Process finished with exit code 1
1) Check settings of IntelliJ by Ctrl-Alt-S. Type 'Maven' and see if you have proper Maven distribution (not the bundled one).
2) Refresh your Maven project from the right hand side of IntelliJ window.
This happens due to several issues which normally fixed after an IDE restart. Well you can try several things,
Do a maven reimport
Do a maven Download sources and documentation
And restart the JIdea IDE
You can try to use a latest maven version and see also.
My System was behind a Proxy which not allowing me to get these packages. I remove the proxy and now it is working fine.
I'm trying to setup SonarQube (v.4.5.6) with maven support. I believe my configuration is correct but I can't get SonarQube analysis to run without errors.
My project's dependencies:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>${logstash-logback-encoder.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<version>${spring-security-test.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
sonar-maven-plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.7.1</version>
</plugin>
SonarQube analysis throws the following errors:
[INFO] [19:07:06.235] Source paths: pom.xml, src/main/java
[INFO] [19:07:06.235] Test paths: src/test/java
[INFO] [19:07:06.235] Binary dirs: target/classes
[INFO] [19:07:08.046] Sensor JavaSquidSensor...
[INFO] [19:07:08.154] Configured Java source version: none
[INFO] [19:07:08.157] JavaClasspath initialization...
[INFO] [19:07:08.173] JavaClasspath initialization done: 16 ms
[INFO] [19:07:08.173] JavaTestClasspath initialization...
[INFO] [19:07:08.202] JavaTestClasspath initialization done: 29 ms
[INFO] [19:07:08.412] Java Main Files AST scan...
[INFO] [19:07:08.414] 27 source files to be analyzed
[ERROR] [19:07:08.849] Class not found: org.springframework.security.openid.OpenIDAuthenticationFilter
[ERROR] [19:07:08.850] Class not found: org.springframework.security.openid.OpenIDConsumer
[ERROR] [19:07:08.850] Class not found: org.openid4java.consumer.ConsumerManager
[ERROR] [19:07:08.850] Class not found: org.springframework.security.openid.OpenIDAuthenticationToken
[ERROR] [19:07:08.851] Class not found: org.openid4java.consumer.ConsumerException
[ERROR] [19:07:08.851] Class not found: org.springframework.security.openid.AxFetchListFactory
[ERROR] [19:07:08.872] Class not found: org.springframework.jdbc.datasource.init.DatabasePopulator
[ERROR] [19:07:08.872] Class not found: org.springframework.jdbc.datasource.init.DataSourceInitializer
[ERROR] [19:07:09.798] Class not found: javax.annotation.Nullable
[INFO] [19:07:10.163] 27/27 source files have been analyzed
[INFO] [19:07:10.163] Java Main Files AST scan done: 1751 ms
[INFO] [19:07:10.165] Java bytecode scan...
[INFO] [19:07:10.238] Java bytecode scan done: 73 ms
[INFO] [19:07:10.239] Java Test Files AST scan...
[INFO] [19:07:10.239] 17 source files to be analyzed
[ERROR] [19:07:10.400] Class not found: org.springframework.security.openid.OpenIDAuthenticationFilter
[ERROR] [19:07:10.400] Class not found: org.springframework.security.openid.OpenIDConsumer
[ERROR] [19:07:10.401] Class not found: org.openid4java.consumer.ConsumerManager
[ERROR] [19:07:10.401] Class not found: org.springframework.security.openid.OpenIDAuthenticationToken
[ERROR] [19:07:10.401] Class not found: org.openid4java.consumer.ConsumerException
[ERROR] [19:07:10.401] Class not found: org.springframework.security.openid.AxFetchListFactory
[INFO] [19:07:11.114] Java Test Files AST scan done: 875 ms
[INFO] [19:07:11.114] 17/17 source files have been analyzed
All mentioned classes are not used in project, which I for me makes more confusing what could be wrong.
You can see that the analysis run until the end without saying it failed. The analysis succeed.
What this message ´Class not found:´ means ?
This is raised by sonarqube java analyzer when it analyzes the dependency of a source file. For instance, if you extends a class from spring, sonarqube java analyzer will look for the corresponding .class file.
If we have a rule that will count the number of hierarchy level, it will then look for the dependency of this .class file and so on. Meaning it will look for some classes that might not be directly in your project.
This message is harmless, it just warns you that the analyzer was not able to find some .class files so you might end up with less accurate results and/or you might want to fix the classpath provided to the analysis.
I am trying to play with Mahout.
Following very simple instructions on the apache website. I'm getting weird dependency errors.
I've created a new project with Maven. I've added this to the pom.xml as suggested:
<dependency>
<groupId>org.apache.mahout</groupId>
<artifactId>mahout-mrlegacy</artifactId>
<version>0.9</version>
</dependency>
now running 'mvn clean install -U' gives me:
Downloading: https://repo.maven.apache.org/maven2/org/apache/mahout/mahout-mrlegacy/0.9/mahout-mrlegacy-0.9.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.689 s
[INFO] Finished at: 2015-03-21T10:54:37+00:00
[INFO] Final Memory: 6M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project my-app: Could not resolve dependencies for project com.mycompany.app:my-app:jar:1.0-SNAPSHOT: Could not find artifact org.apache.mahout:mahout-mrlegacy:jar:0.9 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
Java is too hard! Seriously, I'm a Ruby guy. Now I also tried 'artifactID' as just 'mahout' as I can see that in some of these alleged maven repositories, but same error.
What am I doing wrong???
The documentation of Apache Mahout appears to have a version mix-up. mahout-mrlegacy does not exist in version 0.9, but it will exist in version 0.10.0. For version 0.9, the dependency is actually mahout-core.
Therefore, you should use
<dependency>
<groupId>org.apache.mahout</groupId>
<artifactId>mahout-core</artifactId>
<version>0.9</version>
</dependency>
When 0.10.0 will be released, you will need to use
<dependency>
<groupId>org.apache.mahout</groupId>
<artifactId>mahout-mrlegacy</artifactId>
<version>0.10.0</version>
</dependency>
Add below dependency to your pom.xml
<dependency>
<groupId>org.apache.mahout</groupId>
<artifactId>mahout-mrlegacy</artifactId>
<version>0.9.0.2.2.0.0-2041</version>
</dependency>
And below repositories
<repositories>
<repository>
<id>pentaho-releases</id>
<url>http://repository.pentaho.org/artifactory/repo/</url>
</repository>
</repositories>
For more details:
https://mvnrepository.com/artifact/org.apache.mahout/mahout-mrlegacy/0.9.0.2.2.0.0-2041