eclipse / transformer

Eclipse Transformer provides tools and runtime components that transform Java binaries, such as individual class files and complete JARs and WARs, mapping changes to Java packages, type names, and related resource names.

Home Page:https://projects.eclipse.org/projects/technology.transformer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

no main manifest attribute

coffeebeantraining opened this issue · comments

pulled the source and compiled with mvn package
create a .bat file and ran with results indicating no main manifest?
what am i doing wrong?

D:\workspace\ICAM>go.bat
@echo off
setlocal enabledelayedexpansion

REM Set the path to the Eclipse Transformer tool
set TRANSFORMER_PATH=D:\workspace\ICAM\transformer\org.eclipse.transformer.cli\target\org.eclipse.transformer.cli-0.6.0-SNAPSHOT-distribution.jar

REM Set the directory containing the source JAR files
set SOURCE_DIR=D:\workspace\ICAM\apache-fediz-1.6.1\plugins\tomcat\lib

REM Set the target directory for the transformed JAR files
set TARGET_DIR=D:\workspace\ICAM\apache-fediz-1.6.1\plugins\tomcat\lib\transformed

REM Ensure the target directory exists
if not exist "%TARGET_DIR%" mkdir "%TARGET_DIR%"

for %%F in ("%SOURCE_DIR%*.jar") do (
set "JAR_NAME=%%~nxF"
java -jar "%TRANSFORMER_PATH%" "%%F" "%TARGET_DIR%!JAR_NAME!"
)

endlocal

Results:

no main manifest attribute, in D:\workspace\ICAM\transformer\org.eclipse.transformer.cli\target\org.eclipse.transformer.cli-0.6.0-SNAPSHOT-distribution.jar
no main manifest attribute, in D:\workspace\ICAM\transformer\org.eclipse.transformer.cli\target\org.eclipse.transformer.cli-0.6.0-SNAPSHOT-distribution.jar
no main manifest attribute, in D:\workspace\ICAM\transformer\org.eclipse.transformer.cli\target\org.eclipse.transformer.cli-0.6.0-SNAPSHOT-distribution.jar
no main manifest attribute, in D:\workspace\ICAM\transformer\org.eclipse.transformer.cli\target\org.eclipse.transformer.cli-0.6.0-SNAPSHOT-distribution.jar

The distribution jar is not an executable jar. You need to unzip it into a folder and then java -jar the cli jar from the folder.

The distribution jar is not an executable jar. You need to unzip it into a folder and then java -jar the cli jar from the folder.

@bjhargrave Thank you for the clarification. Do you happen to know if there are any more detailed instructions stashed away somewhere that dives into all of the use case scenarios? For example, converting javax jars to jakara, java src folders to jakarta, etc.
Really appreciated your help.
Mark

Any information would be in this repo. Docs are lacking, so any PRs for the would be useful! Look to the tests for usage examples.

Any information would be in this repo. Docs are lacking, so any PRs for the would be useful! Look to the tests for usage examples.

Thank you, will do.
Just one more question - does the transformer work on war files? What if i have an existing java web app packaged as a war file, but do not have access to the source code. Will the transformer handle those situations?
Thanks,

Yes, it does handle war files. I believe there is a test which confirms that.