You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by asookazian <as...@gmail.com> on 2010/07/23 20:26:46 UTC

adding non-class files to a JAR

anybody know how to get Maven to include non-class files into a JAR?

i have .jrxml files that I precompile into .jasper files via a custom plugin
but maven is not including them in the EAR AFAIK.

how does that work and how can i achieve this?  thx.
-- 
View this message in context: http://maven.40175.n5.nabble.com/adding-non-class-files-to-a-JAR-tp1850724p1850724.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: adding non-class files to a JAR

Posted by Baptiste MATHUS <ml...@batmat.net>.
Your plugin should always generate into the outputDirectory (or
testOutputDirectory).
Please be aware not using "target" in the code. This name can always be
redefined in the pom. Always refer to it as
${project.build.outputDirectory}.

Cheers

Le 5 août 2010 17:16:04 UTC+2, Haszlakiewicz, Eric
<EH...@transunion.com>a écrit :

> >-----Original Message-----
> >From: asookazian [mailto:asookazian@gmail.com]
> >
> >Wayne Fay wrote:
> >>
> >>> anybody know how to get Maven to include non-class files into a JAR?
> >>>
> >>> i have .jrxml files that I precompile into .jasper files via a
> custom
> >>> plugin
> >>> but maven is not including them in the EAR AFAIK.
> >>
> >> Put them in the correct directory (src/main/resources in general) and
> >> they should be bundled into the Jar properly.
>
> >thx for the response.  the compiled .jasper files are in
> sub-directories
> >inside src/main/resources, so perhaps that is the problem and they all
> need
> >to be placed in src/main/resources directly so they are included in the
> >JAR.
> >let me give that a shot!  thx.
>
> If you're trying to include compiled files, I think they should be
> created in the *target* directory.  Putting build output (the .jasper
> files) into the source directories seems wrong.  I just tried a quick
> test, and maven will happily include anything I put in target/classes
> into the jar file.  You probably need to adjust how your .jasper files
> are created so they go in the right place.
>
> eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

RE: adding non-class files to a JAR

Posted by "Haszlakiewicz, Eric" <EH...@transunion.com>.
>-----Original Message-----
>From: asookazian [mailto:asookazian@gmail.com]
>
>Wayne Fay wrote:
>>
>>> anybody know how to get Maven to include non-class files into a JAR?
>>>
>>> i have .jrxml files that I precompile into .jasper files via a
custom
>>> plugin
>>> but maven is not including them in the EAR AFAIK.
>>
>> Put them in the correct directory (src/main/resources in general) and
>> they should be bundled into the Jar properly.

>thx for the response.  the compiled .jasper files are in
sub-directories
>inside src/main/resources, so perhaps that is the problem and they all
need
>to be placed in src/main/resources directly so they are included in the
>JAR.
>let me give that a shot!  thx.

If you're trying to include compiled files, I think they should be
created in the *target* directory.  Putting build output (the .jasper
files) into the source directories seems wrong.  I just tried a quick
test, and maven will happily include anything I put in target/classes
into the jar file.  You probably need to adjust how your .jasper files
are created so they go in the right place.

eric

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


Re: adding non-class files to a JAR

Posted by Wayne Fay <wa...@gmail.com>.
> multiple JARs are packaged in the EAR, so why can't the .jasper files be
> packaged in the appropriate JAR prior to the EAR goal being invoked during
> 'mvn clean install'?

They can, that's fine. You just can't put them directly into the ear
under s/m/r.

Wayne

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


Re: adding non-class files to a JAR

Posted by asookazian <as...@gmail.com>.

Wayne Fay wrote:
> 
>> thx for the response.  the compiled .jasper files are in sub-directories
>> inside src/main/resources, so perhaps that is the problem and they all
>> need
>> to be placed in src/main/resources directly so they are included in the
>> JAR.
> 
> If this is an EAR-packaged project, src/main/resources will not work.
> Read the docs:
> http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

multiple JARs are packaged in the EAR, so why can't the .jasper files be
packaged in the appropriate JAR prior to the EAR goal being invoked during
'mvn clean install'?
-- 
View this message in context: http://maven.40175.n5.nabble.com/adding-non-class-files-to-a-JAR-tp1850724p1864886.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: adding non-class files to a JAR

Posted by Stephane Nicoll <st...@gmail.com>.
And it's not meant to be used with files that will be read from the
classpath anyway. s/m/r (deprecated to src/main/application) is for the
deployment descriptor of the ear only.

S.

---
[image: Linkedin] <http://www.linkedin.com/in/snicoll>[image:
Twitter]<http://twitter.com/snicoll>


On Fri, Jul 23, 2010 at 10:02 PM, Wayne Fay <wa...@gmail.com> wrote:

> > thx for the response.  the compiled .jasper files are in sub-directories
> > inside src/main/resources, so perhaps that is the problem and they all
> need
> > to be placed in src/main/resources directly so they are included in the
> JAR.
>
> If this is an EAR-packaged project, src/main/resources will not work.
> Read the docs:
> http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: adding non-class files to a JAR

Posted by Wayne Fay <wa...@gmail.com>.
> thx for the response.  the compiled .jasper files are in sub-directories
> inside src/main/resources, so perhaps that is the problem and they all need
> to be placed in src/main/resources directly so they are included in the JAR.

If this is an EAR-packaged project, src/main/resources will not work.
Read the docs:
http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html

Wayne

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


Re: adding non-class files to a JAR

Posted by asookazian <as...@gmail.com>.

Wayne Fay wrote:
> 
>> anybody know how to get Maven to include non-class files into a JAR?
>>
>> i have .jrxml files that I precompile into .jasper files via a custom
>> plugin
>> but maven is not including them in the EAR AFAIK.
> 
> Put them in the correct directory (src/main/resources in general) and
> they should be bundled into the Jar properly.
> 
> Ear files are a little bit special. In most cases, you should put the
> non-class files in a jar and then depend on the jar artifact rather
> than putting them directly in the Ear.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

thx for the response.  the compiled .jasper files are in sub-directories
inside src/main/resources, so perhaps that is the problem and they all need
to be placed in src/main/resources directly so they are included in the JAR. 
let me give that a shot!  thx.
-- 
View this message in context: http://maven.40175.n5.nabble.com/adding-non-class-files-to-a-JAR-tp1850724p1861765.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: adding non-class files to a JAR

Posted by Wayne Fay <wa...@gmail.com>.
> anybody know how to get Maven to include non-class files into a JAR?
>
> i have .jrxml files that I precompile into .jasper files via a custom plugin
> but maven is not including them in the EAR AFAIK.

Put them in the correct directory (src/main/resources in general) and
they should be bundled into the Jar properly.

Ear files are a little bit special. In most cases, you should put the
non-class files in a jar and then depend on the jar artifact rather
than putting them directly in the Ear.

Wayne

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


RE: adding non-class files to a JAR

Posted by Martin Gainty <mg...@hotmail.com>.
RFC 1521 and RFC 1522 Mime types only

http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Per-Entry%20Attributes


Martin Gainty 
______________________________________________ 
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: Fri, 23 Jul 2010 11:26:46 -0700
> From: asookazian@gmail.com
> To: users@maven.apache.org
> Subject: adding non-class files to a JAR
> 
> 
> anybody know how to get Maven to include non-class files into a JAR?
> 
> i have .jrxml files that I precompile into .jasper files via a custom plugin
> but maven is not including them in the EAR AFAIK.
> 
> how does that work and how can i achieve this? thx.
> -- 
> View this message in context: http://maven.40175.n5.nabble.com/adding-non-class-files-to-a-JAR-tp1850724p1850724.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
 		 	   		  
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2