Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WsImportMojo: warning "cannot find file for" for test artefacts #15

Closed
phax opened this issue Jun 3, 2016 · 5 comments
Closed

WsImportMojo: warning "cannot find file for" for test artefacts #15

phax opened this issue Jun 3, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@phax
Copy link

phax commented Jun 3, 2016

This warning (like 587 in getWSDLFiles) should not be emitted for artefacts that use scope test or provided or where optional=true is set.

See Artifact.isOptional() and Artifact.SCOPE_TEST.equals( artifact.getScope() ) resp. Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ).
If you want, I can provide a PR

@andham
Copy link
Member

andham commented Jul 5, 2017

I don't understand. All (direct) dependencies of a project should be accessible regardless of scope, so why shouldn't this warning be emitted for test, provided, and optional dependencies?

@phax
Copy link
Author

phax commented Jul 5, 2017

An artefact with scope 'test' is not in the classpath except you run unit tests (mvn test) so a warning on an artifact when this is NOT run in test, is annoying.

Every build warns that an artefact file cannot be found otherwise.

@andham
Copy link
Member

andham commented Jul 5, 2017

But I don't understand why the artifact can't be found. Can you provide a test project for this scenario?

@phax
Copy link
Author

phax commented Jul 5, 2017

sample-project.zip
Here's a stripped down version - not as simple as possible but usable.
Basically the problem is the "dnsjava" artefact referenced in the pom.xml.
When you run mvn generate-sources the second time it is very obivous...

@andham andham self-assigned this Jul 6, 2017
@andham
Copy link
Member

andham commented Jul 6, 2017

OK, I see the issue. Actually I think that there is a bug in the code where all dependencies are used on the Classloader classpath when getting the wsdl files. Test scoped dependencies should only be used in wsimport-test, not in wsimport.
Runtime scoped dependencies should never be used I think, but they are today. If they are to be used in the build they should have compile scope.

@andham andham added bug and removed enhancement labels Jul 6, 2017
@andham andham added this to the 2.5 milestone Jul 6, 2017
andham added a commit to andham/jaxws-maven-plugin that referenced this issue Jul 6, 2017
andham added a commit to andham/jaxws-maven-plugin that referenced this issue Jul 6, 2017
@andham andham closed this as completed in 02ceeef Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants