I am trying to build a RCP product in Jenkins with configuration: maven: 3.0.5 and Java 1.7. It is building locally but failing with the following error in Jenkins.
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
[INFO] [1m------------------------------------------------------------------------[m
[INFO] [1;31mBUILD FAILURE[m
[INFO] [1m------------------------------------------------------------------------[m
[INFO] Total time: 7.360 s
[INFO] Finished at: 2019-10-24T13:55:12-05:00
[INFO] [1m------------------------------------------------------------------------[m
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project myrcp-app: Compilation failure: Compilation failure:
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[8,23] package org.eclipse.swt does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[9,30] package org.eclipse.swt.events does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[10,30] package org.eclipse.swt.events does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[11,32] package org.eclipse.swt.graphics does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[12,30] package org.eclipse.swt.layout does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[13,30] package org.eclipse.swt.layout does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/com/company/myrcp/app/internal/handlers/AboutHandler.java:[14,30] package org.eclipse.swt.layout does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[15,31] package org.eclipse.swt.widgets does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[16,31] package org.eclipse.swt.widgets does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[17,31] package org.eclipse.swt.widgets does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[18,31] package org.eclipse.swt.widgets does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[19,31] package org.eclipse.swt.widgets does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[20,31] package org.eclipse.swt.widgets does not exist
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/internal/handlers/AboutHandler.java:[45,39] cannot find symbol
[ERROR] symbol: class Dialog
[ERROR] location: class com.company.myrcp.app.internal.handlers.AboutHandler
[ERROR] /c:/jenkins/workspace/myrcp-app/src/main/java/com/company/myrcp/app/nternal/handlers/AboutHandler.java:[47,34] cannot find symbol
[ERROR] symbol: class Shell
[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]
The following dependency is also present in POM:
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt</artifactId>
<scope>compile</scope>
</dependency>
Not sure if I have to add any plugins to make it run in Jenkins?
If you are using maven you specify the version. Once you successfully built-in local version you can investigate is all the dependency is available. If you try to run in eclipse internally eclipse understand the dependency and help your build in local.
Fortunately, if you are running Jenkins in another machine to build the code from repo you have to specify the version and maven downloads the dependency and get it build.
It can be eliminated by maintaining the remote repository internally. If you have an internal repo then consider checking the repo availability.
Related
I have a Maven project using Jetty as a runner – in case it's relevant. My pom.xml file contains the following
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>7.17.3</version>
</dependency>
It used to be 7.14.2 and I upgraded it. After cleaning and refreshing, IntelliJ says some of the classes in one of the packages on which transport depends can't be found anymore. I tried forcing refreshes, cleaned the project multiple times, resolving dependencies... nothing, the project doesn't even build anymore because of those missing classes. I figured I'd downgrade it again, just in case I missed a breaking change somewhere but now I have the older version and the classes are still not there. I switched to a branch which I'm sure works and sure enough everything builds and runs just fine.
I checked with mvn dependency:tree and this is what comes up:
[INFO] +- org.elasticsearch.client:transport:jar:7.17.3:compile
[INFO] | +- org.elasticsearch:elasticsearch:jar:7.17.3:compile
[INFO] | | +- org.elasticsearch:elasticsearch-core:jar:7.17.3:compile
[INFO] | | +- org.elasticsearch:elasticsearch-secure-sm:jar:7.17.3:compile
[INFO] | | +- org.elasticsearch:elasticsearch-x-content:jar:7.17.3:compile
elasticsearch-x-content is the package that is supposed to contain those classes and it shows up correctly (in the downgraded version too) but the classes are nowhere to be found.
I have had similar problems in the past where either Maven or IntelliJ IDEA randomly decide to stop seeing things that they were both happy to see just 20 minutes prior, and I never know how I manage to "fix" the issue each time so I don't have a repeatable series of incantations that I can offer as a clue.
Any ideas?
EDIT: I just tried a mvn dependency:purge-local-repository and no joy. I tried refreshing Maven from inside IntelliJ IDEA, nothing. I tried mvn compile and mvn package -U and nope.
EDIT 2: This is the error I'm getting on mvn compile:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[20,40] error: cannot find symbol
[ERROR] package org.elasticsearch.common.xcontent
/Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[21,40] error: cannot find symbol
[ERROR] package org.elasticsearch.common.xcontent
/Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[22,40] error: cannot find symbol
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.623 s
[INFO] Finished at: 2022-04-26T13:56:15+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project isaac-api: Compilation failure: Compilation failure:
[ERROR] /Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[20,40] error: cannot find symbol
[ERROR] package org.elasticsearch.common.xcontent
[ERROR] /Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[21,40] error: cannot find symbol
[ERROR] package org.elasticsearch.common.xcontent
[ERROR] /Users/morpheu5/src/isaac/isaac-api/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ElasticSearchIndexer.java:[22,40] error: cannot find symbol
Did you try running mvn compile from the command line and then refresing the project? Sometimes Intellij will bug out and not actually download a dependency even though it says it's trying to (happened to me a week ago).
I've create a vaadin application with maven using the following comand:
mvn archetype:generate -DarchetypeGroupId=com.vaadin
-DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.7.12-DgroupId=com.example -DartifactId=myapplication -Dversion=0.1 -Dpackaging=war
It has created a right project; Now I'm going to create a custom widget, follow the instruction on
https://vaadin.com/docs/v7/framework/gwt/gwt-eclipse
The wizard new-->other--> Vaadin 8 widget creates the necessary file:
But when I try to compile I get:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
(default-compile) on project myapplication: Compilation failure:
Compilation failure: [ERROR]
/C:/Users/fmi/eclipse-workspace/myapplication/src/main/java/com/example/client/mycomponent/MyComponentWidget.java:[3,37]
package com.google.gwt.user.client.ui does not exist [ERROR]
/C:/Users/fmi/eclipse-workspace/myapplication/src/main/java/com/example/client/mycomponent/MyComponentWidget.java:[6,40]
cannot find symbol [ERROR] symbol: class Label
I know that may be I have to add dependency in the pom, but I'm asking why the wizard has this bug?
Note in the picture I see Vaadin 8 widget, while the project has been created with archetype 7.7
Is a bug in the wizard or a mistake by me?
thanks
I've resolved adding:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
</dependency>
It is necessary to compile widgets; It is still unclear why in the documentation has not reported.
I'm trying to build my project with LWJGL library included, using Maven and VSC, but I can't understand how is it working.
I was looking into http://wiki.lwjgl.org/wiki/Setting_Up_LWJGL_with_Maven.html, but console is saying me, that it doesn't know what methods, which I am using, are...
I'm trying to build example from https://www.lwjgl.org/guide. There is repo for ant build sistem, but it is necessary for me to use Maven. Please, help me to adapt it.
UPD
After I copypasted pom.xml from link given in post, I got following errors:
> Executing task: mvn -B verify <
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for myProject:myGame:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 62, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] --------------------------< myProject:myGame >--------------------------
[INFO] Building myGame 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from slick: http://slick.cokeandcode.com/mavenrepo/slick/slick/274/slick-274.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.873 s
[INFO] Finished at: 2018-09-09T03:13:22+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myGame: Could not resolve dependencies for project myProject:myGame:jar:1.0-SNAPSHOT: Failed to collect dependencies at slick:slick:jar:274: Failed to read artifact descriptor for slick:slick:jar:274: Could not transfer artifact slick:slick:pom:274 from/to slick (http://slick.cokeandcode.com/mavenrepo): slick.cokeandcode.com: Unknown host slick.cokeandcode.com -> [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/DependencyResolutionException
And after I removed every ssection. which was containing 'Slick' (Since it isn't used in test example from lwjgl.org/guide), Maven built project successfully. But I still can't run project. I type java *myclass* and I get
> Exception in thread "main" java.lang.Error: Unresolved compilation
> problems:
> Version cannot be resolved
> The method glfwFreeCallbacks(long) is undefined for the type Main
> The method glfwDestroyWindow(long) is undefined for the type Main
> The method glfwTerminate() is undefined for the type Main
> The method glfwSetErrorCallback(null) is undefined for the type Main
>
> at game.Main.run(Main.java:36)
> at game.Main.main(Main.java:128)
The company gave me a project on data compressor, I have to run the project and reduce it's compression ratio.
To run the project i downloaded all the repositories using maven. But the POM file is giving an error as:
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.influxdb:influxdb-java:jar -> version 1.5 vs 2.4 # line 254, column 16
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: log4j:log4j:jar -> duplicate declaration of version 1.2.17 # line 264, column 22
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.commons:commons-math3:jar -> duplicate declaration of version 3.6.1 # line 302, column 18
[FATAL] Non-resolvable parent POM for teevr-apps-dataxlrator:teevr-dataxlrator:1.1.15: Failure to find teevr-apps:parent-root:pom:1.0.0 in https://repo.eclipse.org/content/repositories/californium/ was cached in the local repository, resolution will not be reattempted until the update interval of repo.eclipse.org has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 11, column 10
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project teevr-apps-dataxlrator:teevr-dataxlrator:1.1.15 (E:\Ubuntu\dataxlrator-master\dataxlrator\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for teevr-apps-dataxlrator:teevr-dataxlrator:1.1.15: Failure to find teevr-apps:parent-root:pom:1.0.0 in (same link as above) was cached in the local repository, resolution will not be reattempted until the update interval of repo.eclipse.org has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 11, column 10 -> [Help 2]
[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:
i ran this project as maven build in eclipse neon.
This is my first question on this site so please forgive me for the inconvenience caused in analyzing my problem.
I think you would find every thing in the project link itself but if I missed something please let me know.
You have duplicated the dependencies in your POM, leave only one for each.
org.influxdb:influxdb-java
log4j:log4j
org.apache.commons:commons-math3
I have to work with an EMF-Project and need to use some of the classes in another package.
When I try to build the generated code with maven I get this Failure:
[INFO] 6 errors
[INFO] -------------------------------------------------------------
[INFO]------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]------------------------------------------------------------------------
[INFO] Total time: 2.844 s
[INFO] Finished at: 2015-03-31T16:25:42+02:00
[INFO] Final Memory: 14M/163M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project datamodel: Compilation failure:
Compilation failure:
[ERROR] /C:/.../util/ModelSwitch.java:[20,34] cannot find symbol
[ERROR] symbol: class Switch
[ERROR] location: package org.eclipse.emf.ecore.util
[ERROR] /C:/.../util/ModelSwitch.java:[85,38] cannot find symbol
[ERROR] symbol: class Switch
[ERROR] /C:/.../util/ModelSwitch.java:[114,9] method does not override or implement a method from a supertype
[ERROR] /C:/.../util/ModelSwitch.java:[126,9] method does not override or implement a method from a supertype
[ERROR] /C:/.../util/ModelSwitch.java:[1341,9] method does not override or implement a method from a supertype
[ERROR] /C:/.../util/ModelAdapterFactory.java:[365,35] method doSwitch in class com...util.ModelSwitch<T1> cannot be applied to given types;
[ERROR] required: int,org.eclipse.emf.ecore.EObject
[ERROR] found: org.eclipse.emf.ecore.EObject
[ERROR] reason: actual and formal argument lists differ in length
All libraries are imported and in the pom, yet it still got problems with the generated ModelSwitch class.
This Error and the fact, that Eclipse Luna is buggy as hell are driving me crazy! Could somebody please help me and explain how to fix this?
Take a look at the different version in the repository. It seems like EMF renamed their artifacts some time ago. Instead of this (analogously for your other EMF dependencies):
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>ecore</artifactId>
<version>2.6.1.v20100914-1218</version>
</dependency>
try to use this form (note the different artifactId):
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.11.0-v20150123-0347</version>
</dependency>
Here, much newer versions are available. For me, every version from 2.8 upwards seems to work. You could also use a range, to always get the latest version:
<version>[2.8.0,2.99.99]</version>
These are the latest versions of the components you have as far as I can tell
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>ecore</artifactId>
<version>2.3.0-v200706262000</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>common</artifactId>
<version>2.3.0-v200706262000</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>2.11.0-v20150123-0347</version>
</dependency>