2014-10-06 3 views
0

Maven을 사용하여 특정 종속 이슈를 포함하는 Jar 파일을 만들고 싶습니다. 일부 소스 Java 파일은 제외 시켰습니다. 예를 들어 (주 SRC/아래 특정 파일을 일부 소스 파일을 제외 할, 그러나 나는 또한 싶습니다종속성이있는 jar를 만들고 특정 소스 파일을 제외하십시오.

  <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-shade-plugin</artifactId> 
      <executions> 
       <execution> 
         <id>shadedJar</id> 
         <phase>package</phase> 
         <goals> 
          <goal>shade</goal> 
         </goals> 
         <configuration> 
          <shadedClassifierName>classifier</shadedClassifierName> 
          <shadedArtifactAttached>true</shadedArtifactAttached> 
          <createDependencyReducedPom>false</createDependencyReducedPom> 
          <artifactSet> 
           <includes> 
            <include>com.google.guava:guava</include> 
           </includes> 
          </artifactSet> 
         </configuration> 
        </execution> 
      </executions> 

따라서, 항아리는 '구아바'유물 파일을 포함 않습니다

현재 나는이 조각을 사용 /java/my.package/) 어떻게 할 수 있습니까?

+0

정확히 어떤 소스 파일입니까? – Mardoz

+0

모듈 원본의 /src/main/java/my.package 폴더 아래에있는 특정 파일을 제외하고 싶습니다. – opeled

답변

0

나는 항아리를 만들기 위해 음영을 사용하지만 개발과 관련이있는 eclipse, txt 및 기타 파일은 필요하지 않습니다.

이것은 내가 가지고있는 코드입니다. 어쩌면 addapt하고 사용할 수 있습니다.

  <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-shade-plugin</artifactId> 
       <version>2.2</version> 
       <executions> 
        <execution> 
         <phase>package</phase> 
         <goals> 
          <goal>shade</goal> 
         </goals> 
         <configuration> 
          <createDependencyReducedPom>false</createDependencyReducedPom> 
          <filters> 
           <filter> 
            <artifact>*:*</artifact> 
            <excludes> 
             <exclude>META-INF/*.SF</exclude> 
             <exclude>META-INF/*.DSA</exclude> 
             <exclude>META-INF/*.RSA</exclude> 
             <exclude>.settings/**</exclude> 
             <exclude>*.classpath</exclude> 
             <exclude>*.project</exclude> 
             <exclude>*.txt</exclude> 
            </excludes> 
           </filter> 
          </filters> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
+0

위대한 도움을 받아 – opeled

+0

@opeled 일반 답변으로 문제를 해결할 수 있으면 해당 게시물을 정답으로 표시하면 티켓이 완료됩니다. –

관련 문제