[izpack-user] izpack maven plugin - are there examples that work?

108 views
Skip to first unread message

GizzPack

unread,
Dec 16, 2008, 12:46:16 PM12/16/08
to us...@izpack.codehaus.org
I was just wondering if anyone out there is using maven to build custom panels and create an installer with izpack and has a sample working pom.xml (simplest example).

I downloaded and copied some from the sample maven pom that was linked off izpack.org, and have spent several days with the examples listed, but I can not get them to work (many problems and one more below).

If you have a pom.xml that you have gotten to work that does everything (does everything and dumps out a single jar file with custom panels integrated), please post.

-- background

<many problems before this one, but this is the latest>

I have my panels in:
   src/main/java/org/izforge/izpack/panels/MyFirstPanel.jar

In my pom.xml file my staging is in /target/staging/

I look in /target/staging/ and there is no /bin/panels directory.

Questions (1..3)
1.  What exactly needs to be added to the pom.xml to mkdir target/staging/bin/panels and dump my panel jars in there?
2.  And also put things in the format that it needs to be in like creating a directory with the same name as the panel under /bin/panels/
3.  and unjarring the jar into that same directory?

Does all of this need to be done manually by hand each and every time? or can it somehow be done inside the pom?

I am really trying to get my first panel working and leverage maven to do all the repetitive tasks.  If this is possible and you have a working pom.xml, please let me know and I will also add some documentation and post so that others can use and get going quickly so as not to spend the time figuring things out because an example is provided.

thanks


--- 

I get the following error:

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] IzPack compilation ERROR

Embedded error: c:\home\product\module\izpack\izpack\target\staging\install.xml:63: Panel jar file not found: c:\home\rsimmons\projects\product\module\izpack\izpack\target\staging\bin\panels\MyFirstPanel.jar
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: IzPack compilation ERROR
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor
.java:564)


Dan Tran

unread,
Dec 16, 2008, 1:29:19 PM12/16/08
to us...@izpack.codehaus.org
before you make the claim that the example does not work, are you able
to get it work out of the box? if it does not work,
tell us.

did you attempt the read the site doc and the trying to understand the
sample/pom.xml?

-D

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


GizzPack

unread,
Dec 16, 2008, 1:40:30 PM12/16/08
to us...@izpack.codehaus.org
I did not get it to work out of the box.  The thing I am struggling with right now is to get a single jar for every custom panel that I have written (3).

and secondly to get those 3 jars into /target/staging/bin/panels/

and thirdly to get a directory created with the same name as the panel under /target/staging/bin/panels/<MyFirstPanelDir>/

and then to unjar the jar mentioned in #1 above un-jarred into the directory in #3.  So far this is what I see is required to develop a custom panel and where all the artifacts go.

So I was hoping to get a pom.xml that does all 4 of these things because I can't see how to make a jar with a single class file in it when all class files are in the same directory under /src/main/java/com/izforge/izpack/panels/*.java  <= one class file per panel but need a jar for each one and a directory for each one and the jar copied and unjarred to the directory mentioned above

so like here is a list of all artifacts that need to be created by the pom from my single .java file (src/main/java/com/izforge/izpack/panels/MyFirstPanel.java)

  target/staging/bin/panels/MyFirstPanel/
  target/staging/bin/panels/MyFirstPanel.jar
  target/staging/bin/panels/MyFirstPanel/com/izforge/izpack/panels/MyFirstPanel.class

and repeat the above for every .java file under /src/main/java/com/izforge/izpack/panels/*.java <= one .java file for each panel.  So there must be 3 artifacts created under staging for each .java file (a directory, a class file and a jar file - 3 artifacts created and put into the right place for each .java file which is a custom panel).

not sure how to accomplish this so if there is a pom.xml file out there that does it all (there must be at least one out there if anyone is actually using maven - izpack plugin).

thank for your help


C

GizzPack

unread,
Dec 16, 2008, 1:44:03 PM12/16/08
to us...@izpack.codehaus.org
To answer your question, I have looked at the sample pom.xml and I do not see in this sample pom.xml file where all 4 things are done for each .java file which is:

1.  create the dir /targeet/staging/bin/panels
2.  create target/staging/bin/panels/<MyPanelDir>
3.  create a jar with a single class file and put in /target/staging/bin/panels/<MyPanel.jar>
4.  unjar the jar in #2 to the dir in #1

and repeat 1..4 for each .java file (for each custom panel).

if all of these are in the sample pom I have missed it and  I can not get it to work. because I get the error message mentioned in the original post.

thanks

C

Dan Tran

unread,
Dec 16, 2008, 2:51:12 PM12/16/08
to us...@izpack.codehaus.org
are you sure you are not able to get it to work with no motification?
if it does not work, tell us. We need to base from some where.

If the pom, i clear state that you can use the maven-jar-plugin to
package multiples custom panel, the example has only one panel, but
you can extend it to package multiple panels thru multiple executions.
and the maven-jar-plugin implicitly create target/staging/bin/panels
directory for you. Obviously you are not trying to understand the
example and jump on it too quickly.

-D

GizzPack

unread,
Dec 16, 2008, 4:20:20 PM12/16/08
to us...@izpack.codehaus.org
I believe the most common case will be multiple panels.  There should probably be a more advanced example of custom panels that extend a custom base, implement an interface. I tried that as well with problems.

I really need to get something today, but not sure how to mkdir with maven or compile a single .java file (from many in a directory) and then copy the jar to another directory.

I understand the simple example but not what I needed to do for more advanced features (build jar for each panel, copy to another dir, mkdir etc)

The next big problem is packaging all the dependencies.  It is going to be a real problem.

thanks


C

Tim Farrell

unread,
Dec 16, 2008, 4:34:25 PM12/16/08
to us...@izpack.codehaus.org
You should really read the source. Open source is notoriously bad at providing adequate documentation so live with or write it. Just my opinion.

Also why this discussed here and not on the maven list? My mail box is getting clogged with all this maven discussion. I'm really only interested in the izpack related content :)

Dan Tran

unread,
Dec 16, 2008, 5:48:00 PM12/16/08
to us...@izpack.codehaus.org
if you need to create custom panels out side of the packaging project,
you need to be well versed with Maven.
Here are suggestions:

- create maven project for each custom panels. Make sure to include
izpack-standalone-compiler as it optional dependency.
since the final packaging already include that jar as well.

- include all neccessary dependencies for each panel for both
compile and runtime.

- in your izpack packaging project.

- includes all custom panels as your depdencies.

- use maven-dependency-plugin to pull all custom panel to
staging/bin/panel directory

- use maven-dependency-plugin to pull all custom panel's
dendencies to a location under staging area ( ie staging/dependency )
and configure your ipack's install.xml merge all those custom
panel's dependencies to the installer


Please read up on maven and read the plugin site configuration
example, and usage and doc

Good luck

-D

GizzPack

unread,
Dec 16, 2008, 6:16:18 PM12/16/08
to us...@izpack.codehaus.org
it is really related to the samples provided with IzPack.  I wish I had the time to look more at the source.  I do not believe most people use open source because they want to appreciate the complexity of the code which seems to be the goal of some types of programmers.

C

Dan Tran

unread,
Dec 17, 2008, 12:52:50 AM12/17/08
to us...@izpack.codehaus.org
Reply all
Reply to author
Forward
0 new messages