You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Maimon Oded <od...@gmail.com> on 2010/10/19 09:55:10 UTC

Assembly Plugin

Hi,
I'm new to maven and I've a basic question that i hope that someone can help
me with, my projects structure looks something like this:

My project structure is simple:
- Project A
  - src
  - conf
    - myxml.xml
  - scripts

- Project B
  - src

I would like to have an assembly for project B that will include only the
myxml.xml file from project A + all the files in project B,
is it possible? how?

thanks,
Oded.

RE: Assembly Plugin

Posted by Martin Gainty <mg...@hotmail.com>.
works on my machine:

        <configuration>
          <descriptors>
            <descriptor>src/assemble/bin.xml</descriptor>
          </descriptors>
        </configuration>

file structure:
pom.xml (located in current folder)
 src (folder of current folder)
   assemble (subfolder of src)
      bin.xml  (contents of assemble subfolder)

did you check to see if the descriptor tag is relative to the location of the pom.xml you are referencing?
is it located in the relative path referenced by descriptor tag?
do you have access to the file?
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Tue, 19 Oct 2010 13:55:25 +0200
> Subject: Re: Assembly Plugin
> From: anders@hammar.net
> To: users@maven.apache.org
> 
> Yes, it works on my machine. :-)
> 
> It's very hard to spot the issue if you don't provide more info.
> 
> /Anders
> On Tue, Oct 19, 2010 at 13:49, Maimon Oded <od...@gmail.com> wrote:
> 
> > Hi,
> > thanks, i was able to use it as a dependency, it was easy, but the problem
> > with the directory structure remains..
> > when my file is src/main/config/myxml.xml and i set the output directory to
> > be conf the result is
> > conf/src/main/config/myxml.xml
> > while i want it to just be
> > conf/myxml.xml
> >
> > i guess that i'm doing something wrong here..
> >
> > thanks.
> >
> > On Tue, Oct 19, 2010 at 1:23 PM, Anders Hammar <an...@hammar.net> wrote:
> >
> > > OK, move the config file to a separate project then. The use the
> > dependency
> > > plugin as someone else suggested, and unpack.
> > >
> > > Have a look at the assembly plugin. You can control which folder stuff is
> > > added to in the archive. (define outputDirectory)
> > >
> > > /Anders
> > > On Tue, Oct 19, 2010 at 12:26, Maimon Oded <od...@gmail.com>
> > wrote:
> > >
> > > > Hi,
> > > > Thanks for the very quick response.
> > > > I've one project that include a configuration file, the same
> > > configuration
> > > > file with same values need to be used in other projects (more than
> > one),
> > > i
> > > > didn't want to keep the same file on multiple projects and maintain
> > each
> > > of
> > > > them.
> > > >
> > > > i can change the structure of the project to maven structure but my
> > issue
> > > > with it is that in assembly that i create i want all files in
> > > > src/main/config to be save to conf directory, but what the assembly
> > > plugin
> > > > does instead is creating directory structure like this
> > > > conf/src/main/config/<files> (i actually need conf/<files>)
> > > >
> > > > this xml file is being used by the other projects by sending the xml
> > path
> > > > as
> > > > a VM parameter...
> > > >
> > > > i hope i made my self clear...
> > > >
> > > > thanks
> > > >
> > > > On Tue, Oct 19, 2010 at 10:48 AM, Anders Hammar <an...@hammar.net>
> > > wrote:
> > > >
> > > > > Your structure is not following the Maven file structure standard.
> > All
> > > > > files
> > > > > should typically be in the appropriate directory below src (like
> > > > > src/main/config, src/main/scripts, etc).
> > > > >
> > > > > I find what you're trying to do strange. We would most likely be able
> > > to
> > > > > suggest a good solution if you provided more info on what you're
> > trying
> > > > to
> > > > > actually achieve.
> > > > >
> > > > > I don't understand why you would like to assemble the content of a
> > > > project
> > > > > plus a minor part of some other project. What's the purpose? Why
> > isn't
> > > > the
> > > > > xml file in the project to begin with?
> > > > >
> > > > > /Anders
> > > > >
> > > > > On Tue, Oct 19, 2010 at 09:55, Maimon Oded <od...@gmail.com>
> > > > wrote:
> > > > >
> > > > > > Hi,
> > > > > > I'm new to maven and I've a basic question that i hope that someone
> > > can
> > > > > > help
> > > > > > me with, my projects structure looks something like this:
> > > > > >
> > > > > > My project structure is simple:
> > > > > > - Project A
> > > > > >  - src
> > > > > >  - conf
> > > > > >    - myxml.xml
> > > > > >  - scripts
> > > > > >
> > > > > > - Project B
> > > > > >  - src
> > > > > >
> > > > > > I would like to have an assembly for project B that will include
> > only
> > > > the
> > > > > > myxml.xml file from project A + all the files in project B,
> > > > > > is it possible? how?
> > > > > >
> > > > > > thanks,
> > > > > > Oded.
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > >
> > > > Oded.
> > > >
> > >
> >
> >
> >
> > --
> >
> >
> > Oded.
> >
 		 	   		  

Re: Assembly Plugin

Posted by Anders Hammar <an...@hammar.net>.
Yes, it works on my machine. :-)

It's very hard to spot the issue if you don't provide more info.

/Anders
On Tue, Oct 19, 2010 at 13:49, Maimon Oded <od...@gmail.com> wrote:

> Hi,
> thanks, i was able to use it as a dependency, it was easy, but the problem
> with the directory structure remains..
> when my file is src/main/config/myxml.xml and i set the output directory to
> be conf the result is
> conf/src/main/config/myxml.xml
> while i want it to just be
> conf/myxml.xml
>
> i guess that i'm doing something wrong here..
>
> thanks.
>
> On Tue, Oct 19, 2010 at 1:23 PM, Anders Hammar <an...@hammar.net> wrote:
>
> > OK, move the config file to a separate project then. The use the
> dependency
> > plugin as someone else suggested, and unpack.
> >
> > Have a look at the assembly plugin. You can control which folder stuff is
> > added to in the archive. (define outputDirectory)
> >
> > /Anders
> > On Tue, Oct 19, 2010 at 12:26, Maimon Oded <od...@gmail.com>
> wrote:
> >
> > > Hi,
> > > Thanks for the very quick response.
> > > I've one project that include a configuration file, the same
> > configuration
> > > file with same values need to be used in other projects (more than
> one),
> > i
> > > didn't want to keep the same file on multiple projects and maintain
> each
> > of
> > > them.
> > >
> > > i can change the structure of the project to maven structure but my
> issue
> > > with it is that in assembly that i create i want all files in
> > > src/main/config to be save to conf directory, but what the assembly
> > plugin
> > > does instead is creating directory structure like this
> > > conf/src/main/config/<files> (i actually need conf/<files>)
> > >
> > > this xml file is being used by the other projects by sending the xml
> path
> > > as
> > > a VM parameter...
> > >
> > > i hope i made my self clear...
> > >
> > > thanks
> > >
> > > On Tue, Oct 19, 2010 at 10:48 AM, Anders Hammar <an...@hammar.net>
> > wrote:
> > >
> > > > Your structure is not following the Maven file structure standard.
> All
> > > > files
> > > > should typically be in the appropriate directory below src (like
> > > > src/main/config, src/main/scripts, etc).
> > > >
> > > > I find what you're trying to do strange. We would most likely be able
> > to
> > > > suggest a good solution if you provided more info on what you're
> trying
> > > to
> > > > actually achieve.
> > > >
> > > > I don't understand why you would like to assemble the content of a
> > > project
> > > > plus a minor part of some other project. What's the purpose? Why
> isn't
> > > the
> > > > xml file in the project to begin with?
> > > >
> > > > /Anders
> > > >
> > > > On Tue, Oct 19, 2010 at 09:55, Maimon Oded <od...@gmail.com>
> > > wrote:
> > > >
> > > > > Hi,
> > > > > I'm new to maven and I've a basic question that i hope that someone
> > can
> > > > > help
> > > > > me with, my projects structure looks something like this:
> > > > >
> > > > > My project structure is simple:
> > > > > - Project A
> > > > >  - src
> > > > >  - conf
> > > > >    - myxml.xml
> > > > >  - scripts
> > > > >
> > > > > - Project B
> > > > >  - src
> > > > >
> > > > > I would like to have an assembly for project B that will include
> only
> > > the
> > > > > myxml.xml file from project A + all the files in project B,
> > > > > is it possible? how?
> > > > >
> > > > > thanks,
> > > > > Oded.
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > >
> > >
> > > Oded.
> > >
> >
>
>
>
> --
>
>
> Oded.
>

Re: Assembly Plugin

Posted by Maimon Oded <od...@gmail.com>.
Hi,
thanks, i was able to use it as a dependency, it was easy, but the problem
with the directory structure remains..
when my file is src/main/config/myxml.xml and i set the output directory to
be conf the result is
conf/src/main/config/myxml.xml
while i want it to just be
conf/myxml.xml

i guess that i'm doing something wrong here..

thanks.

On Tue, Oct 19, 2010 at 1:23 PM, Anders Hammar <an...@hammar.net> wrote:

> OK, move the config file to a separate project then. The use the dependency
> plugin as someone else suggested, and unpack.
>
> Have a look at the assembly plugin. You can control which folder stuff is
> added to in the archive. (define outputDirectory)
>
> /Anders
> On Tue, Oct 19, 2010 at 12:26, Maimon Oded <od...@gmail.com> wrote:
>
> > Hi,
> > Thanks for the very quick response.
> > I've one project that include a configuration file, the same
> configuration
> > file with same values need to be used in other projects (more than one),
> i
> > didn't want to keep the same file on multiple projects and maintain each
> of
> > them.
> >
> > i can change the structure of the project to maven structure but my issue
> > with it is that in assembly that i create i want all files in
> > src/main/config to be save to conf directory, but what the assembly
> plugin
> > does instead is creating directory structure like this
> > conf/src/main/config/<files> (i actually need conf/<files>)
> >
> > this xml file is being used by the other projects by sending the xml path
> > as
> > a VM parameter...
> >
> > i hope i made my self clear...
> >
> > thanks
> >
> > On Tue, Oct 19, 2010 at 10:48 AM, Anders Hammar <an...@hammar.net>
> wrote:
> >
> > > Your structure is not following the Maven file structure standard. All
> > > files
> > > should typically be in the appropriate directory below src (like
> > > src/main/config, src/main/scripts, etc).
> > >
> > > I find what you're trying to do strange. We would most likely be able
> to
> > > suggest a good solution if you provided more info on what you're trying
> > to
> > > actually achieve.
> > >
> > > I don't understand why you would like to assemble the content of a
> > project
> > > plus a minor part of some other project. What's the purpose? Why isn't
> > the
> > > xml file in the project to begin with?
> > >
> > > /Anders
> > >
> > > On Tue, Oct 19, 2010 at 09:55, Maimon Oded <od...@gmail.com>
> > wrote:
> > >
> > > > Hi,
> > > > I'm new to maven and I've a basic question that i hope that someone
> can
> > > > help
> > > > me with, my projects structure looks something like this:
> > > >
> > > > My project structure is simple:
> > > > - Project A
> > > >  - src
> > > >  - conf
> > > >    - myxml.xml
> > > >  - scripts
> > > >
> > > > - Project B
> > > >  - src
> > > >
> > > > I would like to have an assembly for project B that will include only
> > the
> > > > myxml.xml file from project A + all the files in project B,
> > > > is it possible? how?
> > > >
> > > > thanks,
> > > > Oded.
> > > >
> > >
> >
> >
> >
> > --
> >
> >
> > Oded.
> >
>



-- 


Oded.

Re: Assembly Plugin

Posted by Anders Hammar <an...@hammar.net>.
OK, move the config file to a separate project then. The use the dependency
plugin as someone else suggested, and unpack.

Have a look at the assembly plugin. You can control which folder stuff is
added to in the archive. (define outputDirectory)

/Anders
On Tue, Oct 19, 2010 at 12:26, Maimon Oded <od...@gmail.com> wrote:

> Hi,
> Thanks for the very quick response.
> I've one project that include a configuration file, the same configuration
> file with same values need to be used in other projects (more than one), i
> didn't want to keep the same file on multiple projects and maintain each of
> them.
>
> i can change the structure of the project to maven structure but my issue
> with it is that in assembly that i create i want all files in
> src/main/config to be save to conf directory, but what the assembly plugin
> does instead is creating directory structure like this
> conf/src/main/config/<files> (i actually need conf/<files>)
>
> this xml file is being used by the other projects by sending the xml path
> as
> a VM parameter...
>
> i hope i made my self clear...
>
> thanks
>
> On Tue, Oct 19, 2010 at 10:48 AM, Anders Hammar <an...@hammar.net> wrote:
>
> > Your structure is not following the Maven file structure standard. All
> > files
> > should typically be in the appropriate directory below src (like
> > src/main/config, src/main/scripts, etc).
> >
> > I find what you're trying to do strange. We would most likely be able to
> > suggest a good solution if you provided more info on what you're trying
> to
> > actually achieve.
> >
> > I don't understand why you would like to assemble the content of a
> project
> > plus a minor part of some other project. What's the purpose? Why isn't
> the
> > xml file in the project to begin with?
> >
> > /Anders
> >
> > On Tue, Oct 19, 2010 at 09:55, Maimon Oded <od...@gmail.com>
> wrote:
> >
> > > Hi,
> > > I'm new to maven and I've a basic question that i hope that someone can
> > > help
> > > me with, my projects structure looks something like this:
> > >
> > > My project structure is simple:
> > > - Project A
> > >  - src
> > >  - conf
> > >    - myxml.xml
> > >  - scripts
> > >
> > > - Project B
> > >  - src
> > >
> > > I would like to have an assembly for project B that will include only
> the
> > > myxml.xml file from project A + all the files in project B,
> > > is it possible? how?
> > >
> > > thanks,
> > > Oded.
> > >
> >
>
>
>
> --
>
>
> Oded.
>

Re: Assembly Plugin

Posted by Maimon Oded <od...@gmail.com>.
Hi,
Thanks for the very quick response.
I've one project that include a configuration file, the same configuration
file with same values need to be used in other projects (more than one), i
didn't want to keep the same file on multiple projects and maintain each of
them.

i can change the structure of the project to maven structure but my issue
with it is that in assembly that i create i want all files in
src/main/config to be save to conf directory, but what the assembly plugin
does instead is creating directory structure like this
conf/src/main/config/<files> (i actually need conf/<files>)

this xml file is being used by the other projects by sending the xml path as
a VM parameter...

i hope i made my self clear...

thanks

On Tue, Oct 19, 2010 at 10:48 AM, Anders Hammar <an...@hammar.net> wrote:

> Your structure is not following the Maven file structure standard. All
> files
> should typically be in the appropriate directory below src (like
> src/main/config, src/main/scripts, etc).
>
> I find what you're trying to do strange. We would most likely be able to
> suggest a good solution if you provided more info on what you're trying to
> actually achieve.
>
> I don't understand why you would like to assemble the content of a project
> plus a minor part of some other project. What's the purpose? Why isn't the
> xml file in the project to begin with?
>
> /Anders
>
> On Tue, Oct 19, 2010 at 09:55, Maimon Oded <od...@gmail.com> wrote:
>
> > Hi,
> > I'm new to maven and I've a basic question that i hope that someone can
> > help
> > me with, my projects structure looks something like this:
> >
> > My project structure is simple:
> > - Project A
> >  - src
> >  - conf
> >    - myxml.xml
> >  - scripts
> >
> > - Project B
> >  - src
> >
> > I would like to have an assembly for project B that will include only the
> > myxml.xml file from project A + all the files in project B,
> > is it possible? how?
> >
> > thanks,
> > Oded.
> >
>



-- 


Oded.

Re: Assembly Plugin

Posted by Anders Hammar <an...@hammar.net>.
Your structure is not following the Maven file structure standard. All files
should typically be in the appropriate directory below src (like
src/main/config, src/main/scripts, etc).

I find what you're trying to do strange. We would most likely be able to
suggest a good solution if you provided more info on what you're trying to
actually achieve.

I don't understand why you would like to assemble the content of a project
plus a minor part of some other project. What's the purpose? Why isn't the
xml file in the project to begin with?

/Anders

On Tue, Oct 19, 2010 at 09:55, Maimon Oded <od...@gmail.com> wrote:

> Hi,
> I'm new to maven and I've a basic question that i hope that someone can
> help
> me with, my projects structure looks something like this:
>
> My project structure is simple:
> - Project A
>  - src
>  - conf
>    - myxml.xml
>  - scripts
>
> - Project B
>  - src
>
> I would like to have an assembly for project B that will include only the
> myxml.xml file from project A + all the files in project B,
> is it possible? how?
>
> thanks,
> Oded.
>

Re: Assembly Plugin

Posted by Nick Stolwijk <ni...@gmail.com>.
If it is a dependency of Project A and Project B it belongs to its own
module and be treated as a dependency. It is the easiest way, really.

Another option would be to use the dependency plugin unpack goal with
an includes of the needed file. [1]

[1] http://maven.apache.org/plugins/maven-dependency-plugin/unpack-mojo.html

Hth,

Nick Stolwijk
~Java Developer~

IPROFS BV.
Claus Sluterweg 125
2012 WS Haarlem
http://www.iprofs.nl



On Tue, Oct 19, 2010 at 9:55 AM, Maimon Oded <od...@gmail.com> wrote:
> Hi,
> I'm new to maven and I've a basic question that i hope that someone can help
> me with, my projects structure looks something like this:
>
> My project structure is simple:
> - Project A
>  - src
>  - conf
>    - myxml.xml
>  - scripts
>
> - Project B
>  - src
>
> I would like to have an assembly for project B that will include only the
> myxml.xml file from project A + all the files in project B,
> is it possible? how?
>
> thanks,
> Oded.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org