Repository navigation
build: migrate to Lyo 7 and JDK 21 - #1
Merged
Merged
Conversation
added 18 commits
July 14, 2026 14:34
- Add aggregator parent pom (oslc4j-amesim-parent, JDK 21) and a new amesim-loader seam module (EMF-only, version-agnostic): AmesimLoader interface + AmesimLoaderStandaloneImpl (XMI-only, no Python) and AmesimLoaderApiImpl (shells out to the AMESim Python API). - Drop Wink oslc4j-wink + jsr311-api; JAX-RS runtime is now Jersey 2.35 with OSLC4JAMESimApplication extends javax.ws.rs.core.Application + getClasses(). - oslc4j-core 4.1.0; oslc4j-jena-provider/json4j-provider 4.1.0 with the apache-jena-libs BOM excluded and direct jena-core/jena-arq 3.16.0. - web.xml: Tomcat CorsFilter -> Jetty 12 EE8 CrossOriginFilter. - Wire AMESimManager onto the loader seam (remove Runtime.exec/Python XMI generation + EMF ResourceSet loadEcoreModel); reads build OSLC POJOs from the loader, writes via loader.updateParameter/createComponent. - Remove the unavailable SVN backend (svnkit-client/oslc4jsubversion deps commented out; SubversionServiceProviderFactory registration, AMESimSVNFileURLService, and subversion webapp removed). - Delete unused Wink-client helpers OslcRestClient + POSTAMESimCircuitTest. Compiles + packages on JDK 21 (oslc4jamesim.war). Loader unit tests 10/10 pass. (Per plan, the 4.1.0 step is compile/pack verified; SpCatalogIT gate lands at 7.x.)
- javax -> jakarta namespace transform (javax.ws.rs/javax.servlet -> jakarta.*) across the service/application sources. - version.lyo 4.1.0 -> 7.0.0-Alpha.10; Jersey 2.35 -> 3.1.5; jstl 1.2 -> jakarta.servlet.jsp.jstl 3.0.1 (api) + org.glassfish.web impl; javax.servlet-api -> jakarta.servlet-api 6.1.0; javax.servlet.jsp-api -> jakarta.servlet.jsp-api 4.0.0. Dropped the apache-jena-libs BOM exclusion + direct jena deps (oslc4j-jena-provider 7.x brings its own jena). - web.xml -> EE10 (web-app_6_0, jakarta namespace), jakarta.ws.rs.Application; CORS kept as Jetty 12 EE10 CrossOriginFilter (jetty-ee10-servlets bundled as runtime scope). - AMESimManager resilient: configured XMI load falls back to a bundled sample XMI on the classpath (/amesimWorkDir.xmi) so the catalog always serves circuits; a null pythonScriptsDirectory no longer NPEs the fallback. - OSLC4JAMESimApplication.loadPropertiesFile() applies runtime defaults (port 8080, localhost, python dir) and runs first in the static block so the catalog URI is built with a valid port (fixes HTTP 500 "Bad port"). - SpCatalogIT (JUnit 5) on embedded jakarta Jetty 12 EE10 (-P acceptance, activeByDefault): catalog GET is 200 + application/rdf+xml and enumerates AMESim circuits (FlatTwin/DemoModel). mvn clean verify BUILD SUCCESS on JDK 21 (loader 10/10, SpCatalogIT 2/2).
The decoupling skill requires the backend selector to name the chosen implementation. AmesimLoaderProvider already defaults to the standalone implementation (amesim.loader.impl) but was missing the log line.
Extract the Subversion sample-working-copy client (SubversionClient, SubversionFileClient, SvnSampleData) and FileMetadata into a separate oslc4jamesim-svn module so the AMESim adapter compiles and runs standalone without the external svnkit-client / oslc4jsubversion artifacts. Mirrors the oslc4jsimulink-svn module added for the Simulink adapter.
Re-add the Subversion service/manager/factory classes and the subversionfile_html.jsp / subversionfiles_html.jsp JSPs inside the adapter, register the /services/subversionfiles/ endpoint and its service provider, and initialize the SubversionManager on startup so the JSPs render the bundled sample working-copy metadata (BrakingSystem.ame, QuarterCar.ame, sample-user, svn.example.com) without a live Subversion server. Extend SpCatalogIT to assert the SVN collection JSP renders without exceptions and surfaces the sample data, the single-file endpoint does not throw, and the Jetty CrossOriginFilter still emits Access-Control-Allow-Origin. Move the Jetty plugin to the base build so 'mvn jetty:run' starts the server on :8080 (the lifecycle start/stop executions already did).
New standalone jar module that runs the AMESim circuit-creation client against
a live OSLC adapter. POSTAMESimCircuitTest is ported from the deleted Wink-era
client to the modern Lyo 7.x OslcClient (JAX-RS 2.0): it builds the FlatTwin3
sample 1D circuit (components, lines, parameters) as an AMESimElementsToCreate
resource and POSTs it as application/rdf+xml to
<base>/services/<project>/circuit/elementstocreate, with optional HTTP Basic
auth. The Jena + JSON4J providers are registered on the client.
README documents the best-practice run path: build with 'mvn clean install',
start the adapter ('mvn -pl edu.gatech.mbsec.adapter.amesim jetty:run'), then
'mvn -pl oslc4jamesim-clients exec:java' (defaults to
http://localhost:8080/oslc4jamesim, project FlatTwin3; optional user:pass arg).
Verified end-to-end: POST returns HTTP 201 Created.
The default pythonScriptsDirectory was the CWD-relative 'python', which resolves to a non-existent location when the server is launched from the reactor root (e.g. via 'mvn jetty:run-war'), producing a misleading 'Failed to read AMESim XMI ... falling back to bundled' warning on every start. Add a pythonScriptsDirectoryConfigured flag (set only when the value is read from config.properties) and have the loader use the bundled /amesimWorkDir.xmi on the classpath as the correct, launch-directory-independent default. An explicitly configured path that is present but unreadable still warns and falls back.
The war previously had no SLF4J provider, so adapter/Lyo/Jetty logging went
to the NOP logger ('No SLF4J providers were found'). Add logback-classic 1.5.18
as a runtime dependency (slf4j-api is already 2.0.18) and a logback.xml that
logs to the console at INFO, quieting Lyo/Jetty/Jersey to WARN.
Jersey auto-registers WadlFeature, which tries to build a JAXBContext and logs 'JAXBContext implementation could not be found' (there is no Jakarta JAXB on the EE10 classpath). Disable WADL via the jersey.config.server.wadl.disableWadl servlet init param, with a REVISIT note about re-enabling it.
amesim-loader had no .gitignore, so its target/ (jar, classes, test-classes, maven-status) was committed. Add a repo-root .gitignore with target/ (which also covers any module lacking its own .gitignore) and untrack the ignored build output via 'git ls-files -ci --exclude-standard | git rm --cached'. The run also untracks the .settings/ files that the war/resources module .gitignores already ignore but were previously committed. The ecore module's .settings/ files remain tracked (not ignored by any .gitignore) and are left as-is, out of the target/-only scope.
Import org.eclipse.lyo:lyo-bom:7.0.0.Alpha12 in the parent dependencyManagement and centralize the Lyo version in a single lyo.version property. De-pin every dependency the BOM manages (Lyo modules, Jersey 3.1.11, Jena 6.1.0, Jakarta servlet/JSTL, slf4j, commons-*) and the parent manages (EMF, JUnit, the five intranet sibling modules) so modules declare dependencies without <version>. Pins that stay are for libraries the BOM does not cover: opencsv, jetty-ee10, rest-assured, logback, and jakarta.servlet.jsp-api.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
7.0.0.Beta1)AmesimLoaderinterface and two implementations - standalone and Amesim SDK-based. This allows running the demo without an Amesim installation.