Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
528 views
in Technique[技术] by (71.8m points)

java - Netbeans: project's main artifact is processed through maven-shade-plugin

I am building my project with maven-shade-plugin and Netbeans 8.0 is complaining with the following warning:

Project's main artifact is processed through maven-shade-plugin

When the final artifact jar contains classes not originating in current project, NetBeans internal compiler cannot use the sources of the project for compilation. Then changes done in project's source code only appears in depending projects when project is recompiled. Also applies to features like Refactoring which will not be able to find usages in depending projects.

How can I fix this? What can it break?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I found a "fix" by following the instructions over in Apache's Maven Docs

I added the following to my pom in the shade plugin section.

    <configuration>
      <shadedArtifactAttached>true</shadedArtifactAttached>
      <shadedClassifierName>launcher</shadedClassifierName> <!-- Can be any name that makes sense -->
    </configuration>

I now have 2 artifacts but it works for my needs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...