From 766e088109a81cd6c8f5475deb9e1488c8ee008b Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 17 Jan 2019 15:24:07 +1000 Subject: [PATCH] Issue #3241 Jetty runner add missing Main-Class in MANIFEST (#3260) * Issue #3241 no Main Class attribute in MANIFEST for jetty-runner Signed-off-by: olivier lamy --- jetty-runner/pom.xml | 66 +++++++++++++++---- jetty-runner/src/it/settings.xml | 36 ++++++++++ .../it/test-jar-manifest/invoker.properties | 1 + jetty-runner/src/it/test-jar-manifest/pom.xml | 63 ++++++++++++++++++ .../src/it/test-jar-manifest/postbuild.groovy | 10 +++ jetty-runner/src/main/resources/MANIFEST.MF | 1 + 6 files changed, 164 insertions(+), 13 deletions(-) create mode 100644 jetty-runner/src/it/settings.xml create mode 100644 jetty-runner/src/it/test-jar-manifest/invoker.properties create mode 100644 jetty-runner/src/it/test-jar-manifest/pom.xml create mode 100644 jetty-runner/src/it/test-jar-manifest/postbuild.groovy create mode 100644 jetty-runner/src/main/resources/MANIFEST.MF diff --git a/jetty-runner/pom.xml b/jetty-runner/pom.xml index 56965268c9e..f1e76be68dd 100644 --- a/jetty-runner/pom.xml +++ b/jetty-runner/pom.xml @@ -11,8 +11,9 @@ target/distribution ${project.groupId}.runner + false - http://www.eclipse.org/jetty + @@ -35,21 +36,38 @@ - - org.apache.felix - maven-bundle-plugin - - - true - - org.apache.maven.plugins - maven-jar-plugin + maven-invoker-plugin + + + integration-test + integration-test + + install + integration-test + verify + + + - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - + ${java.home} + + ${java.home} + + ${it.debug} + src/it + 600 + ${project.build.directory}/it + ${project.build.directory}/local-repo + src/it/settings.xml + ${skipTests} + + ${maven.dependency.plugin.version} + + + clean + @@ -63,6 +81,28 @@ true + + org.apache.felix + maven-bundle-plugin + + + true + + ${project.build.directory}/NON_USED_MANIFEST + + + + org.apache.maven.plugins + maven-jar-plugin + + + src/main/resources/MANIFEST.MF + + org.eclipse.jetty.runner.Runner + + + + diff --git a/jetty-runner/src/it/settings.xml b/jetty-runner/src/it/settings.xml new file mode 100644 index 00000000000..d64bdb89034 --- /dev/null +++ b/jetty-runner/src/it/settings.xml @@ -0,0 +1,36 @@ + + + + + + it-repo + + true + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + diff --git a/jetty-runner/src/it/test-jar-manifest/invoker.properties b/jetty-runner/src/it/test-jar-manifest/invoker.properties new file mode 100644 index 00000000000..86f8ef2b751 --- /dev/null +++ b/jetty-runner/src/it/test-jar-manifest/invoker.properties @@ -0,0 +1 @@ +invoker.goals = generate-resources diff --git a/jetty-runner/src/it/test-jar-manifest/pom.xml b/jetty-runner/src/it/test-jar-manifest/pom.xml new file mode 100644 index 00000000000..b5fbdd16132 --- /dev/null +++ b/jetty-runner/src/it/test-jar-manifest/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + + + org.eclipse.jetty.its + jetty-runner-it-test + 1.0.0-SNAPSHOT + war + + + + UTF-8 + + + + + + org.eclipse.jetty + jetty-runner + @project.version@ + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + @maven.dependency.plugin.version@ + + + copy-jetty-runner + generate-resources + + copy + + + + + org.eclipse.jetty + jetty-runner + @project.version@ + jar + false + ${project.build.directory}/ + jetty-runner.jar + + + false + true + + + + + + + + diff --git a/jetty-runner/src/it/test-jar-manifest/postbuild.groovy b/jetty-runner/src/it/test-jar-manifest/postbuild.groovy new file mode 100644 index 00000000000..da1a6d99e3c --- /dev/null +++ b/jetty-runner/src/it/test-jar-manifest/postbuild.groovy @@ -0,0 +1,10 @@ +import java.util.jar.* + +File artifact = new File( basedir, "target/jetty-runner.jar" ) +assert artifact.exists() + +JarFile jar = new JarFile( artifact ); + +Attributes manifest = jar.getManifest().getMainAttributes(); + +assert manifest.getValue( new Attributes.Name( "Main-Class" ) ).equals( "org.eclipse.jetty.runner.Runner" ) diff --git a/jetty-runner/src/main/resources/MANIFEST.MF b/jetty-runner/src/main/resources/MANIFEST.MF new file mode 100644 index 00000000000..fa816753df9 --- /dev/null +++ b/jetty-runner/src/main/resources/MANIFEST.MF @@ -0,0 +1 @@ +Comment: Jetty Runner