Create an Eclipse plugin project that depends on the org.omg.sysml plugin.
Try to import and use any of the classes from the org.omg.sysml.api package.
The following project reproduces the problem: sysml.client.zip. The relevant part:
import org.omg.sysml.ApiClient;
import org.omg.sysml.ApiException;
import org.omg.sysml.Configuration;
import org.omg.sysml.api.CommitApi;
import org.omg.sysml.api.ProjectApi;
import org.omg.sysml.model.Commit;
import org.omg.sysml.model.Project;
//...
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:9000"); // the SysML v2 API and Services pilot implementation is used
ProjectApi projectApi = new ProjectApi(defaultClient);
CommitApi commitApi = new CommitApi(defaultClient);
try {
Project project = projectApi.postProject(new Project());
Commit commit = commitApi.postCommitByProject(project.getAtId(), new Commit(), null);
} catch (ApiException e) {
// ...
}
Expected output: The code compiles and runs without an exception, the appropiate requests are sent.
Actual output: The code does not compile, instead the following compile errors arise:
ApiClient cannot be resolved to a type
ApiException cannot be resolved to a type
CommitApi cannot be resolved to a type
CommitApi cannot be resolved to a type
Commit cannot be resolved to a type
Commit cannot be resolved to a type
Configuration cannot be resolved
ProjectApi cannot be resolved to a type
ProjectApi cannot be resolved to a type
Project cannot be resolved to a type
Project cannot be resolved to a type
The import org.omg.sysml.api cannot be resolved
The import org.omg.sysml.api cannot be resolved
The import org.omg.sysml.ApiClient cannot be resolved
The import org.omg.sysml.ApiException cannot be resolved
The import org.omg.sysml.Configuration cannot be resolved
The import org.omg.sysml.model cannot be resolved
The import org.omg.sysml.model cannot be resolved
Additional info: Adding the API jar directly as a dependency will remove compile errors, but instead causes a LinkageError in runtime, revealing that the API classes are already loaded. This suggests that the API package isn't properly exported from the org.omg.sysml plugin.
We believe that the jar file should not be added as an extra classpath entry, and the api packages should be exported.
SysMLv2 Pilot Implementation version: 2022-05 (commit: ST6RI-545 Updated constraint in RiskMetadata::Level to use "that". on June 15th, 2022)
Steps to reproduce:
org.omg.sysml
plugin.org.omg.sysml.api
package.The following project reproduces the problem: sysml.client.zip. The relevant part:
Expected output: The code compiles and runs without an exception, the appropiate requests are sent.
Actual output: The code does not compile, instead the following compile errors arise:
Additional info: Adding the API jar directly as a dependency will remove compile errors, but instead causes a
LinkageError
in runtime, revealing that the API classes are already loaded. This suggests that the API package isn't properly exported from theorg.omg.sysml
plugin.We believe that the jar file should not be added as an extra classpath entry, and the api packages should be exported.