cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to add dependencies needed for generated beans?

j_ballmann
Discoverer
0 Likes
717

Hello Experts,

I want to use annotations in my -beans.xml bean-declaration as per https://help.hybris.com/6.6.0/hcd/8bc53579866910149472ccbef0222ec5.html (section "Improvements in Beans Generating Mechanism"). Specifically i've done something like the following:

 <bean class="com.dotsource.MyBean">
   <import type="javax.validation.constraints.Min"/>
   <property name="someInteger" type="Integer>
     <annotations scope="member">
       @Min(value = 1L)
     </annotations>
   </property>
 </bean>

When I do an ant clean all I get the following error:

 [ycodegenerator]  
      [echo]       building models from /home/johannes/git/hybrisproject/bin/platform/bootstrap/gensrc to /home/johannes/git/hybrisproject/bin/platform/bootstrap/bin/models.jar
    [yjavac] Compiling 1353 source files to /home/johannes/git/hybrisproject/bin/platform/bootstrap/modelclasses
    [yjavac] /home/johannes/git/hybrisproject/bin/platform/bootstrap/gensrc/com/dotsource/MyModel.java:20: error: package javax.validation.constraints does not exist
    [yjavac] import javax.validation.constraints.Min;
    [yjavac]                                    ^


I've tried adding validation-api to external-dependencies.xml and adding the validation extension dependency to extensioninfo.xml - both still with the same error-message.

How can I correctly introduce the dependency to the model compiler?

Accepted Solutions (0)

Answers (1)

Answers (1)

j_ballmann
Discoverer
0 Likes

Can be solved by copying the dependency to platform/bootstrap/lib via ant customize. We choose to validate the bean manually though, so I can't provide specific details.