Maven compilation Failure on EMF-Project - java

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>

Related

Why does Maven randomly stop seeing dependencies and how do I make it?

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).

vaadin widgetset do not work. bug in maven plugin vaadin

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.

Jenkins build failed: package org.eclipse.swt does not exist

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.

Jenkin build fails after maven dependencies upgrade

Recently, I was working on upgrading the dependencies of one of my team's projects. After changes, project built successfully locally on my laptop. But the same code change threw compilation error on Jenkins.
The errors I am encountering is related to class file for xxx.xxx.xxx. not found in powermockito package. Attaching some relevant pieces of code for reference.
Pervious pom version used:
... some lines above it ...
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--dropwizard versions-->
<dropwizard.version>1.3.5</dropwizard.version>
<dropwizard.swagger.version>1.0.0-2-auth-SNAPSHOT</dropwizard.swagger.version>
<dropwizard.bundle.version>1.3.5-1</dropwizard.bundle.version>
<dropwizard.requestinfo>1.3.5-3</dropwizard.requestinfo>
<dropwizard.rosey.data.provider.version>1.3.5-3</dropwizard.rosey.data.provider.version>
<dropwizard.service.discovery>1.3.5-0</dropwizard.service.discovery>
<dropwizard.rmq.actor.version>1.2.2-1</dropwizard.rmq.actor.version>
<dropwizard.riemann.version>1.3.5-4</dropwizard.riemann.version>
<!--hystrix versions-->
<hystrix.dropwizard.version>0.4</hystrix.dropwizard.version>
<hystrix.configurator.version>0.0.6</hystrix.configurator.version>
<hystrix.version>1.5.3</hystrix.version>
<hystrix.wrapper.version>1.0-SNAPSHOT</hystrix.wrapper.version>
<!--internal clients-->
<user-service-model.version>1.7.91</user-service-model.version>
<kratos.version>0.8.2-SNAPSHOT</kratos.version>
<rosey.dropwizard.config>1.14</rosey.dropwizard.config>
<!--others-->
<mysql.driver.version>5.1.38</mysql.driver.version>
<okhttp3.version>3.4.1</okhttp3.version>
<lombok.version>1.18.8</lombok.version>
<junit.version>4.12</junit.version>
<powemock.version>1.7.3</powemock.version>
<h2.version>1.4.191</h2.version>
<square.okhttp.version>3.4.1</square.okhttp.version>
<rmq.version>4.1.0</rmq.version>
<zookeeper.version>3.4.13</zookeeper.version>
<curator.version>4.0.1</curator.version>
</properties>
... some lines below it ...
Current pom version used:
... some lines above it ...
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--dropwizard versions-->
<dropwizard.version>1.3.12</dropwizard.version>
<dropwizard.swagger.version>1.3.7-1</dropwizard.swagger.version>
<dropwizard.bundle.version>1.3.5-1</dropwizard.bundle.version>
<dropwizard.requestinfo>1.3.5-8</dropwizard.requestinfo>
<dropwizard.rosey.data.provider.version>1.3.5-6</dropwizard.rosey.data.provider.version>
<dropwizard.service.discovery>1.3.12-3</dropwizard.service.discovery>
<dropwizard.rmq.actor.version>1.3.12-1</dropwizard.rmq.actor.version>
<dropwizard.db.sharding.bundle.version>1.3.12-3</dropwizard.db.sharding.bundle.version>
<dropwizard.riemann.version>1.3.12-1</dropwizard.riemann.version>
<!--hystrix versions-->
<hystrix.dropwizard.version>0.4</hystrix.dropwizard.version>
<hystrix.configurator.version>0.0.6</hystrix.configurator.version>
<hystrix.version>1.5.3</hystrix.version>
<!--internal clients-->
<user-service-model.version>1.7.96-STAGE-SNAPSHOT</user-service-model.version>
<kratos.version>0.9.6</kratos.version>
<rosey.dropwizard.config>1.15</rosey.dropwizard.config>
<!-- storage -->
<aerospike.version>3.3.0</aerospike.version>
<mock.aerospike.version>0.0.4</mock.aerospike.version>
<!--others-->
<okhttp3.version>3.4.1</okhttp3.version>
<lombok.version>1.18.8</lombok.version>
<junit.version>4.12</junit.version>
<powemock.version>1.7.3</powemock.version>
<guava.version>28.0-jre</guava.version>
<h2.version>1.4.199</h2.version>
<rmq.version>5.7.2</rmq.version>
<zookeeper.version>3.4.13</zookeeper.version>
<curator.version>4.2.0</curator.version>
<sentinel.model.version>1.0-SNAPSHOT</sentinel.model.version>
</properties>
... some lines below it ...
Shortend error logs:
... some code above it ...
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/MerchantResourceTest.java:[19,1] cannot access org.powermock.api.support.membermodification.MemberModifier
class file for org.powermock.api.support.membermodification.MemberModifier not found
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/VPAResourceTest.java:[29,1] static import only from classes and interfaces
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/VPAResourceTest.java:[30,1] static import only from classes and interfaces
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/services/PrimerServiceTest.java:[28,1] static import only from classes and interfaces
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/services/PrimerServiceTest.java:[29,1] static import only from classes and interfaces
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/AddressResourceTest.java:[22,1] static import only from classes and interfaces
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/AddressResourceTest.java:[23,1] static import only from classes and interfaces
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/services/WalletServiceTest.java:[27,1] static import only from classes and interfaces
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/services/WalletServiceTest.java:[28,1] static import only from classes and interfaces
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/MerchantResourceTest.java:[24,25] cannot access org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner
class file for org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner not found
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/VPAResourceTest.java:[37,25] incompatible types: java.lang.Class<org.powermock.modules.junit4.PowerMockRunner> cannot be converted to java.lang.Class<? extends org.junit.runner.Runner>
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/BaseResourceTest.java:[26,19] package org.mockito does not exist
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/BaseResourceTest.java:[30,26] package org.mockito does not exist
[ERROR] /var/lib/jenkins/jobs/UserService_Develop/workspace/src/test/java/com/xxxxxxx/userservice/resources/BaseResourceTest.java:[30,1] static import only from classes and interfaces
... some code below it ...
Experiment I did: When I removed the test scope from the powermockito dependency, everything worked like a charm.
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powemock.version}</version>
<scope>test</scope> <- This line
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powemock.version}</version>
<scope>test</scope> <- This line
</dependency>
Pasting mockito's maven dependency tree below
... some line above it ...
[INFO] +- org.powermock:powermock-api-mockito:jar:1.7.3:test
[INFO] | +- org.powermock:powermock-api-mockito-common:jar:1.7.3:test
[INFO] | | \- org.powermock:powermock-api-support:jar:1.7.3:test
[INFO] | \- org.mockito:mockito-core:jar:1.10.19:test
[INFO] +- org.powermock:powermock-module-junit4:jar:1.7.3:test
[INFO] | +- org.powermock:powermock-module-junit4-common:jar:1.7.3:test
[INFO] | | +- org.powermock:powermock-reflect:jar:1.7.3:test
[INFO] | | \- org.powermock:powermock-core:jar:1.7.3:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
... some lines below it ...
Maven command which is executing on Jenkins, below sample is taken from console log:
Executing Maven: -B -f /var/lib/jenkins/jobs/UserService_Develop/workspace/pom.xml -U clean package cobertura:cobertura docker:build docker:push -Pdocker -Dproject.version=1.8.23-SNAPSHOT -Dbuild.number=1501 -Dbuild.revision=9d8d00591c23b061b07e1a08c00ff024db8ba318 -Dmaven.test.failure.ignore=true -DskipTests -DargLine=-Xmx512m
Ideally, it should not have happened. I googled for few days found this blog Why your tests may pass locally but fail in Jenkins. Unfortunately, nothing seems to work for me. Need some assitance here. Thanks!
Your experiment shows that the dependency tree is not the problem. What is the problem is the scope of the dependency. The test scope only adds the dependency to the classpath for test compilation and test execution.
What may go wrong here is that your test classes are actually compiled in the compile phase, not the test-compile phase. A test you can do to check this is to leave the scope as test and try to build the project with mvn compile, which should NOT build the test sources if everything is configured correctly.
Other than that, is it hard to guess what exactly your are doing and where it could go wrong without seeing the complete pom.xml, but I hope this gives you a starting point.
Here is an hypothesis on why code compiled when you removed the test scope:
In terms of scope, Maven documentation suggests the following:
compile
This is the default scope, used if none is specified. Compile
dependencies are available in all classpaths of a project.
Furthermore, those dependencies are propagated to dependent projects.
test
This scope indicates that the dependency is not required for normal
use of the application, and is only available for the test compilation
and execution phases. This scope is not transitive.
Now, this may mean that the classpath for scope test compilation may potentially differ from the classpath for scope compile
When you removed the test scope, the mockito jars were found as the default scope is compile

Can't include LWJGL using Maven in Visual Studio Code

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)

Categories

Resources