Ok it works now...

I slightly modified the descriptor and it now does exactly what I wanted.

Thanks a lot !

2007/7/19, John Casey <[EMAIL PROTECTED]>:

Looks like it got snagged by the spam filters...trying again with a tgz...

-john

'


On Jul 19, 2007, at 3:48 PM, John Casey wrote:

Hmm, I've put together a test project hierarchy to try and replicate the
descriptor-not-found problem, and can't...no matter whether I put the
configuration in the <plugin> element or the <execution> element, and no
matter whether I call the build from the parent pom or the child (where the
assembly is bound)...I'm attaching the test I put together, so you can check
it out and maybe tell me what's different. BTW, I checked this with JDK
1.4 and Maven 2.0.7.
Thanks,

-john



On Jul 19, 2007, at 3:25 AM, Rodolphe Beck wrote:

Here is the situation:

If I put the assembly descriptor into
Sample_batch/src/assembly/batch.xml
And the plugin definition in
Sample_batch/pom.xml like:
http://paste2.org/p/4936

Wether I put : 'src/assembly/batch.xml' or '/src/assembly/batch.xml' or
'../Sample_batch/src/assembly/batch.xml', the error is still:
http://paste2.org/p/4938

If I let the descriptor into
Sample_batch/src/assembly/batch.xml
And if I put the definition into
Sample_pom/pom.xml using this path:
'../Sample_batch/src/assembly/batch.xml'
it finds the descriptor but the error is then: Failed to create assembly:
Error creating assembly archive: You must set at least one file.
Probabely because the assembly zip file would be empty.

2007/7/19, John Casey <[EMAIL PROTECTED]>:


You put the plugin configuration in your batch POM, and the
descriptor is in src/assembly/batch.xml within the batch
project...and it cannot find the descriptor?

Can you paste the relevant portion of that batch POM, along with the
error stacktrace? You can get the stacktrace using the -e flag on the
maven build (to output errors).

I use this all the time, without problem...so there must be some
miscommunication.

-john


On Jul 18, 2007, at 11:29 AM, Rodolphe Beck wrote:

> It still doesn't work when I include the <plugin></plugin> in my
> batch's POM
> (it can't find the descriptor)
>
> If I include it in my super POM, the error message is :
>
> Failed to create assembly: Error creating assembly archive: You
> must set at
> least one file.
>
> 2007/7/18, John Casey <[EMAIL PROTECTED]>:
>>
>> I think you might be better off using a dependencySet in your
>> assembly descriptor, and specifying the plugin configuration from the
>> sample_batch module, not in the sample_pom level.
>>
>> The assembly descriptor would probably look something like this:
>>
>> <assembly>
>>    <id>batch</id>
>>    <formats>
>>      <format>zip</format>
>>    </formats>
>>
>>    <includeBaseDirectory>false</includeBaseDirectory>
>>
>>    <dependencySets>
>>      <dependencySet>
>>        <outputDirectory>lib</outputDirectory>
>>      </dependencySet>
>>    </dependencySets>
>>
>>    <fileSets>
>>      <fileSet>
>>        <directory>src/main/resources</directory>
>>        <outputDirectory>/</outputDirectory>
>>      </fileSet>
>>    </fileSets>
>> </assembly>
>>
>> Now, if you put this in the sample_batch POM using something like the
>> following, you should be able to build the zip archive along with any
>> normal build:
>>
>> <project>
>>    [...]
>>
>>    <build>
>>      <plugins>
>>        [...]
>>
>>        <plugin>
>>          <artifactId>maven-assembly-plugin</artifactId>
>>          <!-- It's good practice to be very explicit about the plugin
>> version you want. -->
>>          <version>2.2-beta-1</version>
>>
>>          <executions>
>>            <execution>
>>              <id>batch-assembly</id>
>>              <phase>package</phase>
>>              <goals>
>>                <goal>single</goal>
>>              </goals>
>>              <configuration>
>>                <descriptors>
>>                  <descriptor>src/assembly/batch.xml</descriptor>
>>                </descriptors>
>>              </configuration>
>>            </execution>
>>          </executions>
>>        </plugin>
>>      </plugins>
>>    </build>
>> </project>
>>
>> Hope that helps,
>>
>> --john
>>
>> On Jul 18, 2007, at 4:48 AM, Rodolphe Beck wrote:
>>
>> > Hello,
>> >
>> > I'm trying to manage a bunch of modules with maven. I currently
>> > have ear
>> > projects, simple java projects, web projects and batch projects.
>> > For the
>> > first ones, I have no problem, but for the batch ones i'm having
>> some
>> > issues.
>> >
>> > Here is what I want :
>> >
>> > I have one batch project that will be used to launch operations on
>> > databases, basically, the .sh will be placed on crontab ant
>> > periodically
>> > launch a jar file that contains the code to run.
>> >
>> > Here is how I created my projects:
>> > Sample_pom : contains the superpom (in order to edit it easily with
>> > eclipse)
>> > Sample_batch : contains the batch in src/main/resources
>> > Sample_java : contains one java class
>> >
>> > Sample_java is in Sample_batch's dependencies.
>> >
>> > My packaging is simple : I want a zip file containing the .sh file
>> > at the
>> > root and the jar(s) in a 'lib' folder.
>> >
>> > I managed to create such a file, but it is not perfect, here are my
>> > two main
>> > issues:
>> >
>> > First I couldn't put the <plugin></plugin> to invoke assembly
>> > plugin in the
>> > pom of the batch project as an error message is fired telling it
>> > can't find
>> > the descriptor, i I put the plugin part in the superpom and the
>> > descriptor
>> > in my project:
>> >
>> > http://paste2.org/p/4892
>> >
>> > Second, my .zip is created in the target directory of the
>> Sample_pom
>> > project, I'd rather have it in the target directory of Sample_batch
>> > project,
>> > is it possible ?
>> >
>> > Third, my zip contains a folder named Sample_batch-1.0-SNAPSHOT.jar
>> > and I
>> > couldn't get rid of it (descriptor included)
>> >
>> > http://paste2.org/p/4893
>> >
>> > As you see, I tried to exclude * in binaries but the folder is
>> > still here...
>> >
>> > Thanks for your help !
>> >
>> > --
>> > Cordialement/Regards,
>> > Rodolphe Beck
>> > [EMAIL PROTECTED]
>>
>> ---
>> John Casey
>> Committer and PMC Member, Apache Maven
>> mail: jdcasey at commonjava dot org
>> blog: http://www.ejlife.net/blogs/john
>>
>>
>>
>
>
> --
> Cordialement,
> Rodolphe Beck
> [EMAIL PROTECTED]

---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john





--
Cordialement,
Rodolphe Beck
[EMAIL PROTECTED]


---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john



---
John Casey
Sonatype, Inc. - http://www.sonatype.com
email: jdcasey at sonatype dot com
blog: http://blogs.sonatype.com/jdcasey








--
Cordialement,
Rodolphe Beck
[EMAIL PROTECTED]

Reply via email to