Skip to content

Distribution should not contain Jacoco instrumented classes #6

@haumacher

Description

@haumacher

I built the lib myself with mvn install and got an unusable version that caused a NoClassDefFoundError when deployed to a Tomcat web container:

java.lang.NoClassDefFoundError: org/jacoco/agent/rt/internal_c13123e/Offline
	org.simplejavamail.utils.mail.dkim.DkimSigner.$jacocoInit(DkimSigner.java)
	org.simplejavamail.utils.mail.dkim.DkimSigner.<clinit>(DkimSigner.java)
	de.haumacher.phoneblock.mail.MailSignature.createSigner(MailSignature.java:19)
	de.haumacher.phoneblock.mail.MailService.dkimSignMessage(MailService.java:272)
	de.haumacher.phoneblock.mail.MailService.sendMail(MailService.java:255)
	de.haumacher.phoneblock.mail.MailService.sendMail(MailService.java:238)
	de.haumacher.phoneblock.mail.MailService.sendActivationMail(MailService.java:126)
	de.haumacher.phoneblock.app.EMailVerificationServlet.doPost(EMailVerificationServlet.java:70)
	jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590)
	jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
	de.haumacher.phoneblock.app.CacheControlFilter.doFilter(CacheControlFilter.java:46)
	de.haumacher.phoneblock.app.RememberedLoginFilter.requestLogin(RememberedLoginFilter.java:22)
	de.haumacher.phoneblock.app.LoginFilter.doFilter(LoginFilter.java:121)
	de.haumacher.phoneblock.app.ContentSecurityPolicyFilter.doFilter(ContentSecurityPolicyFilter.java:24)
	de.haumacher.phoneblock.app.ContentTypeOptionFilter.doFilter(ContentTypeOptionFilter.java:27)

I don't know, whether this issue also exists in the official distribution, since I was not able to use this due to Issue #5. But by default, I don't think that instrumented classes should be installed.

I was able to fix this by adding

<jacoco.skip>true</jacoco.skip>

to the properties section - but I don't know, whether this is the "ultimate" solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions