fix fragment from dependent projects #1623
Signed-off-by: olivier lamy <olamy@webtide.com>
This commit is contained in:
parent
4d43261031
commit
008158d975
|
@ -291,7 +291,11 @@ public class JettyRunMojo extends AbstractJettyMojo
|
|||
.collect( Collectors.toList() );
|
||||
webApp.getMetaData().getContainerResources().addAll( dependencyResources );
|
||||
webApp.setWebInfLib (getDependencyFiles());
|
||||
|
||||
// webApp.getWebInfLib().addAll( dependencyResources //
|
||||
// .stream() //
|
||||
// .map( resource -> toFile(resource) ) //
|
||||
// .collect( Collectors.toList() ) );
|
||||
webApp.getDependentProjects().addAll( dependencyResources );
|
||||
//get copy of a list of war artifacts
|
||||
Set<Artifact> matchedWarArtifacts = new HashSet<Artifact>();
|
||||
|
||||
|
@ -373,7 +377,17 @@ public class JettyRunMojo extends AbstractJettyMojo
|
|||
getLog().info("Webapp directory = " + webAppSourceDirectory.getCanonicalPath());
|
||||
}
|
||||
|
||||
|
||||
private static File toFile(Resource resource)
|
||||
{
|
||||
try
|
||||
{
|
||||
return resource.getFile();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new RuntimeException( e.getMessage(), e );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -104,9 +104,7 @@ public class JettyWebAppContext extends WebAppContext
|
|||
private Resource _quickStartWebXml;
|
||||
private String _originAttribute;
|
||||
private boolean _generateOrigin;
|
||||
|
||||
|
||||
|
||||
private List<Resource> dependentProjects = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Set the "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern" with a pattern for matching jars on
|
||||
|
@ -322,6 +320,11 @@ public class JettyWebAppContext extends WebAppContext
|
|||
return _webInfJars;
|
||||
}
|
||||
|
||||
public List<Resource> getDependentProjects()
|
||||
{
|
||||
return dependentProjects;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void setGenerateQuickStart (boolean quickStart)
|
||||
{
|
||||
|
|
|
@ -93,6 +93,8 @@ public class MavenWebInfConfiguration extends WebInfConfiguration
|
|||
public void preConfigure(WebAppContext context) throws Exception
|
||||
{
|
||||
super.preConfigure(context);
|
||||
((JettyWebAppContext)context).getDependentProjects()
|
||||
.stream().forEach( resource -> context.getMetaData().addWebInfJar( resource ) );
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue