-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #3241 Jetty runner add missing Main-Class in MANIFEST #3260
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,9 @@ | |
<properties> | ||
<assembly-directory>target/distribution</assembly-directory> | ||
<bundle-symbolic-name>${project.groupId}.runner</bundle-symbolic-name> | ||
<it.debug>false</it.debug> | ||
</properties> | ||
<url>http://www.eclipse.org/jetty</url> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
|
@@ -35,21 +36,38 @@ | |
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<configuration> | ||
<!-- jetty-runner is not an OSGi component --> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<artifactId>maven-invoker-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>integration-test</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>install</goal> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<archive> | ||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> | ||
</archive> | ||
<javaHome>${java.home}</javaHome> | ||
<environmentVariables> | ||
<JAVA_HOME>${java.home}</JAVA_HOME> | ||
</environmentVariables> | ||
<debug>${it.debug}</debug> | ||
<projectsDirectory>src/it</projectsDirectory> | ||
<timeoutInSeconds>600</timeoutInSeconds> | ||
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> | ||
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if my local repo path is different? or even on a different drive? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, this is in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's the repo path for the forked maven invocation :) so don't worry http://maven.apache.org/plugins/maven-invoker-plugin/run-mojo.html#localRepositoryPath |
||
<settingsFile>src/it/settings.xml</settingsFile> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ew! i don't understand this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we use a settings file which simply use your local repo as a mirror (so we do not download all the internet again :) ) |
||
<skipInvocation>${skipTests}</skipInvocation> | ||
<scriptVariables> | ||
<maven.dependency.plugin.version>${maven.dependency.plugin.version}</maven.dependency.plugin.version> | ||
</scriptVariables> | ||
<goals> | ||
<goal>clean</goal> | ||
</goals> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
|
@@ -63,6 +81,28 @@ | |
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>maven-bundle-plugin</artifactId> | ||
<configuration> | ||
<!-- jetty-runner is not an OSGi component --> | ||
<skip>true</skip> | ||
<!-- there is no way to skip MANIFEST creation by the plugin so just configure dummy location --> | ||
<manifestLocation>${project.build.directory}/NON_USED_MANIFEST</manifestLocation> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifestFile>src/main/resources/MANIFEST.MF</manifestFile> | ||
<manifest> | ||
<mainClass>org.eclipse.jetty.runner.Runner</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<settings> | ||
<profiles> | ||
<profile> | ||
<id>it-repo</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<repositories> | ||
<repository> | ||
<id>local.central</id> | ||
<url>@localRepositoryUrl@</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>local.central</id> | ||
<url>@localRepositoryUrl@</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
</profiles> | ||
</settings> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals = generate-resources |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
|
||
|
||
<groupId>org.eclipse.jetty.its</groupId> | ||
<artifactId>jetty-runner-it-test</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
|
||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
|
||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-runner</artifactId> | ||
<version>@project.version@</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>@maven.dependency.plugin.version@</version> | ||
<executions> | ||
<execution> | ||
<id>copy-jetty-runner</id> | ||
<phase>generate-resources</phase> | ||
<goals> | ||
<goal>copy</goal> | ||
</goals> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-runner</artifactId> | ||
<version>@project.version@</version> | ||
<type>jar</type> | ||
<overWrite>false</overWrite> | ||
<outputDirectory>${project.build.directory}/</outputDirectory> | ||
<destFileName>jetty-runner.jar</destFileName> | ||
</artifactItem> | ||
</artifactItems> | ||
<overWriteReleases>false</overWriteReleases> | ||
<overWriteSnapshots>true</overWriteSnapshots> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
|
||
</build> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" ) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Comment: Jetty Runner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG, what is going on here??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be sure the forked maven used the current java version