Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Java tools & IDE's > Maven и assembly плагин


Автор: Tony 29.10.2009, 21:36
Привет. Столкнулся с проблемой. Надо собрать простой проект в jar. Проблема в том что надо собрать архив в котором будет разпакованный один dependencies. Тоесть получается или все депенденцы запихать в архив или не одного. Примера не нашёл. Пробывал:
Код
 assembly file: 
<dependencySet>
            <outputDirectory>/</outputDirectory>
            <scope>compile</scope>
            <includes>
                <include>com.sun.xml:saaj-impl</include>
            </includes>
            <unpack>true</unpack>
        </dependencySet>


Не помогло. 

Автор: 4EJIOBEK 30.10.2009, 10:08
Код

<assembly>

    <id>bundle</id>

    <formats>
        <format>jar</format>
    </formats>

    <includeBaseDirectory>false</includeBaseDirectory>

    <dependencySets>
        <dependencySet>
            <useStrictFiltering>true</useStrictFiltering>
            <includes>
                <include>com.sun.xml:saaj-impl</include>
            </includes>
            <unpack>true</unpack>
        </dependencySet>
    </dependencySets>
</assembly>


должно работать

Автор: Tony 30.10.2009, 11:06
Применил настройки из твоего примера.
Вызаываю фазу packae: 
 mvn clean package
Pom:
Код

<plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>LATEST</version>
    <executions>
                  <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                      <goal>single</goal>
                    </goals>
                  </execution>
                </executions>
                <inherited>false</inherited>
                <configuration>
                  <descriptors>
                    <descriptor>assm.xml</descriptor>
                  </descriptors>
                </configuration>
            </plugin>

Кричит:
Код

[WARNING] While downloading com.sun.xml:saaj-impl:1.3
  This artifact has been relocated to com.sun.xml.messaging.saaj:saaj-impl:1.3.


[WARNING] The following patterns were never triggered in this artifact inclusion filter:
o  'com.sun.xml:saaj-impl'

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] : org.apache.maven.plugin.assembly.model.Assembly@19481b2
Assembly is incorrectly configured: bundle

Assembly: bundle is not configured correctly: One or more filters had unmatched criteria. Check debug log for more information.


Автор: 4EJIOBEK 30.10.2009, 12:55
скорее всего неправильно задана сама зависимость
Цитата

[WARNING] While downloading com.sun.xml:saaj-impl:1.3
  This artifact has been relocated to com.sun.xml.messaging.saaj:saaj-impl:1.3.


попробуй 
Код

<include>com.sun.xml.messaging.saaj:saaj-impl</include>


Автор: Tony 30.10.2009, 16:48
Спасибо. Правельное название groupId помогло.  smile 

Автор: Старовъръ 30.10.2009, 21:16
А есть пример как собрать весь проект с зависимостями(и самими модулями) в один jar? Ну или просто в папку, без разницы... А то у меня все зависимости собираются, а сами модули - не..

Автор: 4EJIOBEK 2.11.2009, 12:49
Если после dependency set задать!?
Код

 <fileSets>
   <fileSet>
     <directory>target/classes</directory> 
     <outputDirectory /> 
     <includes>
       <include>**/*</include> 
     </includes>
   </fileSet>
 </fileSets>

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)