try to fix web fragment for directory classes #1623

Signed-off-by: olivier lamy <olamy@webtide.com>
This commit is contained in:
olivier lamy 2017-06-23 20:35:59 +10:00
parent 7e27f03884
commit 52fa23b968
3 changed files with 22 additions and 5 deletions

View File

@ -247,6 +247,18 @@
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>apache.snaphots</id>
<url>https://repository.apache.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</project>

View File

@ -40,6 +40,8 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/**
* This goal is used in-situ on a Maven project without first requiring that the project
@ -281,14 +283,18 @@ public class JettyRunMojo extends AbstractJettyMojo
if (useTestScope && (testClassesDirectory != null))
webApp.setTestClasses (testClassesDirectory);
webApp.getClassPathFiles().addAll( getDependencyProjects() );
List<File> dependencyProjects = getDependencyProjects();
webApp.getClassPathFiles().addAll( dependencyProjects );
List<Resource> dependencyResources = //
dependencyProjects.stream() //
.map( file -> Resource.newResource( file ) ) //
.collect( Collectors.toList() );
webApp.getMetaData().getContainerResources().addAll( dependencyResources );
webApp.setWebInfLib (getDependencyFiles());
//get copy of a list of war artifacts
Set<Artifact> matchedWarArtifacts = new HashSet<Artifact>();
//process any overlays and the war type artifacts
List<Overlay> overlays = new ArrayList<Overlay>();
for (OverlayConfig config:warPluginInfo.getMavenWarOverlayConfigs())

View File

@ -276,8 +276,7 @@ public class MetaInfConfiguration extends AbstractConfiguration
if (LOG.isDebugEnabled()) LOG.debug(jar+" META-INF/web-fragment.xml checked");
if (jar.isDirectory())
{
//TODO ????
webFrag = jar.addPath("/META-INF/web-fragment.xml");
webFrag = Resource.newResource( new File (jar.getFile(),"/META-INF/web-fragment.xml"));
}
else
{