Sorry,

I missed that you don't want to attach the assembly generation to the lifecycle.

The proposed solution with the separate executions will not work in this scenario as maven only reads the plugin level configuration (<plugin/><configuration/>) when a goal is invoked directly from the command line. The only option I see is to use profiles then.

What I don't understand is the error message you get. I get a simple:

  [INFO] Error reading assemblies: No assembly descriptors found.

And that's expected, as there in no one defined in the plugin level configuration. The assembly descriptor it's searching isn't even declared in the pom you posted. Is it defined in some parent pom?

-Tim

Ritz, Martin schrieb:

my pom is:

        <plugin>
           <artifactId>maven-assembly-plugin</artifactId>
           <version>2.2-beta-1</version>
           <executions>
             <execution>
               <id>assemblyone</id>
               <phase>package</phase>
               <goals>
                 <goal>single</goal>
               </goals>
               <configuration>
                 <finalName>templates</finalName>
                 <appendAssemblyId>false</appendAssemblyId>
                 <descriptors>
                   
<descriptor>src/main/assembly/assembly_descriptor_templates.xml</descriptor>
                 </descriptors>
                </configuration>
              </execution>
             <execution>
               <id>assemblytwo</id>
               <phase>package</phase>
               <goals>
                 <goal>single</goal>
               </goals>
               <configuration>
                 <descriptors>
                  
<descriptor>src/main/assembly/assembly_descriptor_srcs.xml</descriptor>
                        
<descriptor>src/main/assembly/assembly_descriptor_deploy.xml</descriptor>
                 </descriptors>
               </configuration>
             </execution>
           </executions>
</plugin>
and I use the same structure (like your post)

if I bind the plugin to the package phase everything works fine - the 
assemblies are built in the right way.
I don't want to bind - i want to execute the plugin by the 'assembly:single' 
command.
If I use this command i get the error below:


[INFO] Error reading assemblies: Error locating assembly descriptor file: 
D:\MRRITZ\workspace\xi\editools\trunk_m2\analyser\assembly_descriptor.xml

D:\*\assembly_descriptor.xml (The System couldn't find the file)
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error reading 
assemblies: Error locating assembly descriptor file: 
D:\MRRITZ\workspace\xi\editools\trunk_m2\analyser\assembly_descriptor.xml
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error reading 
assemblies: Error locating assembly descriptor file: 
D:\MRRITZ\workspace\xi\editools\trunk_m2\analyser\assembly_descriptor.xml
        at 
org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:257)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        ... 16 more
Caused by: org.apache.maven.plugin.assembly.io.AssemblyReadException: Error 
locating assembly descriptor file: 
D:\MRRITZ\workspace\xi\editools\trunk_m2\analyser\assembly_descriptor.xml
        at 
org.apache.maven.plugin.assembly.io.DefaultAssemblyReader.getAssemblyFromDescriptorFile(DefaultAssemblyReader.java:174)
        at 
org.apache.maven.plugin.assembly.io.DefaultAssemblyReader.readAssemblies(DefaultAssemblyReader.java:75)
        at 
org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:253)
        ... 18 more
Caused by: java.io.FileNotFoundException: 
D:\MRRITZ\workspace\xi\editools\trunk_m2\analyser\assembly_descriptor.xml (Das 
System kann die angegebene Datei nicht finden = System could not find file)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at java.io.FileReader.<init>(FileReader.java:55)
        at 
org.apache.maven.plugin.assembly.io.DefaultAssemblyReader.getAssemblyFromDescriptorFile(DefaultAssemblyReader.java:169)
        ... 20 more


What could be the reason for this error?

Thx Martin



-----Ursprüngliche Nachricht-----
Von: Tim Kettler [mailto:[EMAIL PROTECTED] Gesendet: Montag, 24. September 2007 12:40
An: Maven Users List
Betreff: Re: AW: how to specify the name of assembled distribution file

It's working for me with this testproject:

.
|-- pom.xml
`-- src
     `-- main
         |-- assembly
         |   |-- A.xml
         |   |-- B.xml
         |   `-- C.xml
         `-- java
             `-- TestClass.java

pom.xml:
   <project>
     <modelVersion>4.0.0</modelVersion>
     <groupId>my-test-group</groupId>
     <artifactId>my-test-artifact</artifactId>
     <version>1.0-SNAPSHOT</version>

     <build>
       <plugins>
         <plugin>
           <artifactId>maven-assembly-plugin</artifactId>
           <version>2.2-beta-1</version>
           <executions>
             <execution>
               <id>execution-one</id>
               <phase>package</phase>
               <goals>
                 <goal>single</goal>
               </goals>
               <configuration>
                 <finalName>CUSTOM</finalName>
                 <appendAssemblyId>false</appendAssemblyId>
                 <descriptors>
                   <descriptor>src/main/assembly/A.xml</descriptor>
                 </descriptors>
                </configuration>
              </execution>
             <execution>
               <id>execution-two</id>
               <phase>package</phase>
               <goals>
                 <goal>single</goal>
               </goals>
               <configuration>
                 <descriptors>
                   <descriptor>src/main/assembly/B.xml</descriptor>
                   <descriptor>src/main/assembly/C.xml</descriptor>
                 </descriptors>
               </configuration>
             </execution>
           </executions>
         </plugin>
       </plugins>
     </build>
   </project>

The only difference is that I used the 'single' goal instead of the 'attached' one and I changed the lone <descriptor/> tag to be in a <descriptors/> list as well (I just noticed that the lone descriptor tag will be depricated).

If you can't get it working just post the relevant ouptut of 'mvn -X ...' and hopefully we can figure it out together.

-Tim

Ritz, Martin schrieb:
thx for the quick response but i get an error if i split
like you told me.
Error:
the system couln't find the assembly descriptor file...
But i have declared the right path and filename and the
files are existing.
Any hint what i'am doing wrong?

Martin

Hi,

split the plugin configuration in distinct executions:

   <plugin>
     <artifactId>maven-assembly-plugin</artifactId>
     <executions>
       <execution>
         <id>execution-one</id>
         <goals>
           <goal>attached</goal>
         </goals>
         <configuration>
           <finalName>customName</finalName>
           <appendAssemblyId>false</appendAssemblyId>
           <descriptor>src\main\assembly\a.xml</descriptor>
         </configuration>
       </execution>

       <execution>
         <id>execution-two</id>
         <goals>
           <goal>attached</goal>
         </goals>
         <configuration>
           <descriptors>
             <descriptor>src\main\assembly\b.xml</descriptor>
             <descriptor>src\main\assembly\c.xml</descriptor>
           </descriptors>
         </configuration>
       </execution>
     </executions>
   </plugin>

-Tim

Ritz, Martin schrieb:
Hi,

i want to specify the name of one of three triggered
assembly descriptors.
I have three different assemblies to build and the name of
one should
be

templates.zip instead of test-0.8.7-SNAPSHOT-templates.zip

If i declare the name with the <finalName> i define the
element of all assemblies.
Is there a way to declare the finalName in the
assembly-descriptor?
I dont want to use an extra profile.


assembly-plugin in my pom
...
<plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <descriptors>
<descriptor>src\main\assembly\a.xml</descriptor>
<descriptor>src\main\assembly\b.xml</descriptor>
<descriptor>src\main\assembly\c.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
...

__
regards
Martin Ritz


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to