|
11 | 11 | import org.eclipse.core.resources.IncrementalProjectBuilder;
|
12 | 12 | import org.eclipse.core.runtime.CoreException;
|
13 | 13 | import org.eclipse.core.runtime.IPath;
|
14 |
| -import org.eclipse.core.runtime.NullProgressMonitor; |
15 | 14 | import org.eclipse.m2e.core.MavenPlugin;
|
16 | 15 | import org.eclipse.m2e.core.embedder.ArtifactKey;
|
17 | 16 | import org.eclipse.m2e.core.internal.IMavenConstants;
|
@@ -243,6 +242,27 @@ private void _testProvidedManifest(String pomLocation) throws Exception
|
243 | 242 | assertTrue("Invalid Classpath in manifest : " + manifest, manifest.contains("Class-Path: custom.jar"));
|
244 | 243 | }
|
245 | 244 |
|
| 245 | + @Test |
| 246 | + public void test006_UseDefaultManifestFile() throws Exception |
| 247 | + { |
| 248 | + IProject project = importProject("projects/mavenarchiver/mavenarchiver-p006/pom.xml"); |
| 249 | + waitForJobsToComplete(); |
| 250 | + |
| 251 | + IFile manifestFile = project.getFile("src/main/resources/META-INF/MANIFEST.MF"); |
| 252 | + assertTrue("The manifest was deleted", manifestFile.exists()); |
| 253 | + |
| 254 | + // trigger a full build |
| 255 | + project.build( IncrementalProjectBuilder.FULL_BUILD, monitor ); |
| 256 | + waitForJobsToComplete(); |
| 257 | + assertNoErrors(project); |
| 258 | + |
| 259 | + IFile generatedManifestFile = project.getFile("target/classes/META-INF/MANIFEST.MF"); |
| 260 | + assertTrue("A manifest is missing", generatedManifestFile.exists()); |
| 261 | + |
| 262 | + String manifest =getAsString(generatedManifestFile); |
| 263 | + assertTrue("Built-By is invalid:"+manifest, manifest.contains("Built-By: You know who")); |
| 264 | + } |
| 265 | + |
246 | 266 | public void testMECLIPSEWTP163_ParentMustBeResolved()
|
247 | 267 | throws Exception
|
248 | 268 | {
|
|
0 commit comments