You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by vasm <aj...@krawlernetworks.com> on 2010/02/24 08:10:58 UTC

XML Files in Maven Jar

Hi All,
I am new to maven. I have created a new maven project to create a jar file.
I have a few xml files in classpath as well. When i build the project only
the  java files (i.e. class files) get included in jar. The xml files are
excluded. Can anyone please help. How to include these xml files in jar as
well. Any kind of help is appreciated.

Thanx.
-- 
View this message in context: http://old.nabble.com/XML-Files-in-Maven-Jar-tp27714119p27714119.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: XML Files in Maven Jar

Posted by vasm <aj...@krawlernetworks.com>.
Thanx a lot. It worked for me.

djrobo wrote:
> 
> Files that do not get compiled, but still need to be put in the jar should
> be put in src/main/resources.
> 
> 
> vasm wrote:
>> 
>> Hi All,
>> I am new to maven. I have created a new maven project to create a jar
>> file. I have a few xml files in classpath as well. When i build the
>> project only the  java files (i.e. class files) get included in jar. The
>> xml files are excluded. Can anyone please help. How to include these xml
>> files in jar as well. Any kind of help is appreciated.
>> 
>> Thanx.
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/XML-Files-in-Maven-Jar-tp27714119p27714177.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: XML Files in Maven Jar

Posted by djrobo <mj...@gmail.com>.
Files that do not get compiled, but still need to be put in the jar should be
put in src/main/resources.


vasm wrote:
> 
> Hi All,
> I am new to maven. I have created a new maven project to create a jar
> file. I have a few xml files in classpath as well. When i build the
> project only the  java files (i.e. class files) get included in jar. The
> xml files are excluded. Can anyone please help. How to include these xml
> files in jar as well. Any kind of help is appreciated.
> 
> Thanx.
> 

-- 
View this message in context: http://old.nabble.com/XML-Files-in-Maven-Jar-tp27714119p27714175.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: XML Files in Maven Jar

Posted by Eduardo M KALINOWSKI <ed...@kalinowski.com.br>.
On Qua, 24 Fev 2010, Thomas Sundberg wrote:
> Hi!
>
> Where are the xml files located in your project?
>
> They will be included automatically if you place them in
>
> src/main/resources

He's probably converting an existing project to use Maven, and so it's  
not layed out in Maven's preferred structure.


-- 
"Little else matters than to write good code."
		-- Karl Lehenbauer

Eduardo M KALINOWSKI
eduardo@kalinowski.com.br


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


Re: XML Files in Maven Jar

Posted by Thomas Sundberg <ts...@kth.se>.
Hi!

Where are the xml files located in your project?

They will be included automatically if you place them in

src/main/resources

hth
Thomas

On Wed, Feb 24, 2010 at 08:10, vasm <aj...@krawlernetworks.com> wrote:
>
> Hi All,
> I am new to maven. I have created a new maven project to create a jar file.
> I have a few xml files in classpath as well. When i build the project only
> the  java files (i.e. class files) get included in jar. The xml files are
> excluded. Can anyone please help. How to include these xml files in jar as
> well. Any kind of help is appreciated.
>
> Thanx.
> --
> View this message in context: http://old.nabble.com/XML-Files-in-Maven-Jar-tp27714119p27714119.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
>
>



-- 
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/

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


Re: XML Files in Maven Jar

Posted by Jochen Wiedmann <jo...@gmail.com>.
Put them into src/main/resources, rather than src/main/java. If you
don't like that default behaviour, create an element like
build/resources/resource with directory src/main/java. In the latter
case, be sure to exclude **/*.java and **/package*.html .

Jochen


On Wed, Feb 24, 2010 at 8:10 AM, vasm <aj...@krawlernetworks.com> wrote:
>
> Hi All,
> I am new to maven. I have created a new maven project to create a jar file.
> I have a few xml files in classpath as well. When i build the project only
> the  java files (i.e. class files) get included in jar. The xml files are
> excluded. Can anyone please help. How to include these xml files in jar as
> well. Any kind of help is appreciated.
>
> Thanx.
> --
> View this message in context: http://old.nabble.com/XML-Files-in-Maven-Jar-tp27714119p27714119.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
>
>



-- 
Germanys national anthem is the most boring in the world - how telling!

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