You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Maurício Linhares <ma...@phoebus.com.br> on 2006/12/04 22:34:48 UTC
Generating the POM with the schema definition
Hi guys,
The Maven Embedder schema writer does not generate the pom.xml with the
schema definitions, so I went out for the maven-model and generated the
sources and I haven't found a way to add the schema defiition without
changing the generated sources (something that is truly evil).
The code that needs to be added is the following:
private void writeModel(Model model, String tagName, XmlSerializer
serializer)
throws java.io.IOException
{
if ( model != null )
{
serializer.startTag( NAMESPACE, tagName );
serializer.attribute(NAMESPACE, "xmlns",
"http://maven.apache.org/POM/4.0.0");
serializer.attribute(NAMESPACE, "xmlns:xsi",
"http://www.w3.org/2001/XMLSchema-instance");
serializer.attribute(NAMESPACE, "xsi:schemaLocation",
"http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd");
Is there any easier way to do this?
The true problem is, everytime I add a dependency using the M2Eclipse
plugin it removes my schema definition =(
--
------------------------------------------------------------------------
Maurício Linhares de Aragão Junior
Estagiário
Avenida Rui Carneiro, 300, Sala 804
Miramar, João Pessoa-Pb, Brasil
CEP: 58032-100
+55 83 3243-0800 (Fone)
+55 83 3243-1014 (Fax)
www.phoebus.com.br
Esta mensagem pode conter informação confidencial e/ou privilegiada,
sendo seu sigilo protegido por lei. Se você não for o destinatário ou a
pessoa autorizada a receber esta mensagem, não pode usar, copiar ou
divulgar as informações nela contidas ou tomar qualquer ação baseada
nessas informações. Se você recebeu esta mensagem por engano, por favor,
avise imediatamente ao remetente, respondendo o e-mail e em seguida
apague-a. Agradecemos sua cooperação.
This message may contain confidential and/or privileged information and
its confidentiality is protected by law. If you are not the addressed or
authorized person to receive this message, you must not use, copy,
disclose or take any action based on it or any information herein. If
you have received this message by mistake, please advise the sender
immediately by replying the e-mail and then deleting it. Thank you for
your cooperation.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org