mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-23 17:41:28 +01:00
removed a reported exception for javadoc or sources jar files for not having a manifest
Former-commit-id: bebbf0a2ef45f8d035a8420e036c6ac034a89760
This commit is contained in:
@@ -219,8 +219,7 @@ public class JarAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
* pom.
|
* pom.
|
||||||
* @return whether or not evidence was added to the dependency
|
* @return whether or not evidence was added to the dependency
|
||||||
*/
|
*/
|
||||||
@edu.umd.cs.findbugs.annotations.SuppressWarnings(
|
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "OS_OPEN_STREAM",
|
||||||
value = "OS_OPEN_STREAM",
|
|
||||||
justification = "The reader on line 259 is closed by closing the zipEntry")
|
justification = "The reader on line 259 is closed by closing the zipEntry")
|
||||||
protected boolean analyzePOM(Dependency dependency) throws IOException, AnalysisException {
|
protected boolean analyzePOM(Dependency dependency) throws IOException, AnalysisException {
|
||||||
boolean foundSomething = false;
|
boolean foundSomething = false;
|
||||||
@@ -514,9 +513,15 @@ public class JarAnalyzer extends AbstractAnalyzer implements Analyzer {
|
|||||||
|
|
||||||
final Manifest manifest = jar.getManifest();
|
final Manifest manifest = jar.getManifest();
|
||||||
if (manifest == null) {
|
if (manifest == null) {
|
||||||
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.SEVERE,
|
//don't log this for javadoc or sources jar files
|
||||||
String.format("Jar file '%s' does not contain a manifest.",
|
if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar")
|
||||||
dependency.getFileName()));
|
&& !dependency.getFileName().toLowerCase().endsWith("-javadoc.jar")
|
||||||
|
&& !dependency.getFileName().toLowerCase().endsWith("-src.jar")
|
||||||
|
&& !dependency.getFileName().toLowerCase().endsWith("-doc.jar")) {
|
||||||
|
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.SEVERE,
|
||||||
|
String.format("Jar file '%s' does not contain a manifest.",
|
||||||
|
dependency.getFileName()));
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Attributes atts = manifest.getMainAttributes();
|
final Attributes atts = manifest.getMainAttributes();
|
||||||
|
|||||||
Reference in New Issue
Block a user