sarl: Errors in Maven compiler, not in Eclipse compiler

Hi,

When building our SARL project via Eclipse, it builds fine with no errors. When building with Maven however, this is the result:

[INFO] Validate and generate.
[INFO] Starting validation for input: 'ElevatorSimActions.sarl'
[INFO] Starting validation for input: 'ElevatorSimPercepts.sarl'
[INFO] Starting validation for input: 'ChangeEnvironment.sarl'
[ERROR] ERROR:Invalid implemented type: 'io.sarl.elevatorsim.multiagent.Environment'. Only subtypes of 'io.sarl.lang.core.Capacity' are allowed for 'ChangeEnvironment'. (file:/C:/Users/klep/Documents/SARL%20Elevator%20Project/workspace/sarl-controller/SARLbasicController/src/main/sarl/io/sarl/elevatorsim/multiagent/ChangeEnvironment.sarl line : 13 column : 36)
[ERROR] ERROR:Missing implemented type 'io.sarl.lang.core.Capacity' for 'ChangeEnvironment'. (file:/C:/Users/klep/Documents/SARL%20Elevator%20Project/workspace/sarl-controller/SARLbasicController/src/main/sarl/io/sarl/elevatorsim/multiagent/ChangeEnvironment.sarl line : 13 column : 36)
[ERROR] ERROR:The method enact(ElevatorSimAction) of type ChangeEnvironment must override a superclass method. (file:/C:/Users/klep/Documents/SARL%20Elevator%20Project/workspace/sarl-controller/SARLbasicController/src/main/sarl/io/sarl/elevatorsim/multiagent/ChangeEnvironment.sarl line : 17 column : 2)
[INFO] Starting validation for input: 'ElevatorAgent.sarl'
[INFO] Starting validation for input: 'Environment.sarl'
[INFO] Starting validation for input: 'SimulatorInteraction.sarl'
[ERROR] ERROR:Invalid implemented type: 'io.sarl.elevatorsim.SimulatorPush'. Only subtypes of 'io.sarl.lang.core.Capacity' are allowed for 'SimulatorInteraction'. (file:/C:/Users/klep/Documents/SARL%20Elevator%20Project/workspace/sarl-controller/SARLbasicController/src/main/sarl/io/sarl/elevatorsim/SimulatorInteraction.sarl line : 24 column : 16)
[ERROR] ERROR:The method pushSendCarAction(SendCarAction) of type SimulatorInteraction must override a superclass method. (file:/C:/Users/klep/Documents/SARL%20Elevator%20Project/workspace/sarl-controller/SARLbasicController/src/main/sarl/io/sarl/elevatorsim/SimulatorInteraction.sarl line : 84 column : 5)
[INFO] Starting validation for input: 'SimulatorProxyAgent.sarl'
[INFO] Starting validation for input: 'SimulatorPush.sarl'
[ERROR] Execution failed due to a severe validation error.

This appears as if it is similar to #380. For reference, we are currently building with SARL Maven Plugin 0.4.0 due to #503.

If it helps, I can provide some of the problem files or our pom.xml.

Cheers,

Matt

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 32 (22 by maintainers)

Commits related to this issue

Most upvoted comments

Dear @ssardina.

The following command line is not the good one:

java -cp ~/.m2/repository/sarl-controller/sarl-controller/0.3.3/sarl-controller-0.3.3.jar:/home/ssardina/.m2/repository/io/janusproject/io.janusproject.plugin/0.4.1/io.janusproject.plugin-0.4.1.jar io.janusproject.Boot io.sarl.elevatorsim.SimulatorProxyAgent

Why is it not the good one?

The io.janusproject.plugin module contains the compiled of the Janus platform, but not the classes of the other libraries that are needed running Janus. Consequently, when you launch the application with a standard Java approach, class files are missed from the classpath.

For solving this issue, you could use two approaches:

java -cp ~/.m2/repository/sarl-controller/sarl-controller/0.3.3/sarl-controller-0.3.3.jar:/path/to/io.janusproject.kernel-2.0.5.0-with-dependencies.jar io.janusproject.Boot io.sarl.elevatorsim.SimulatorProxyAgent

We have planed to make the things easier from the CLI, see #149.

Stéphane.