문제

So you are writing a groovy script with some Java in it in GMaven. In between the source tags:

<source>

...some groovy code here

List<Chicken> = new ArrayList<>()

...some more groovy code here

</source>

Problem the < and the > look like XML tag components. Is there a way to escape those and if so, what is it?

도움이 되었습니까?

해결책 2

Yes, you can escape them with XML/HTML entities

List&lt;Chicken&gt; = new ArrayList&lt;&gt;()

Reference :
List of XML and HTML character entity references

다른 팁

Nest the code in CDATA.

Check out this: http://www.w3schools.com/xml/xml_cdata.asp

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top