You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lukasz Lenart <lu...@googlemail.com> on 2009/04/08 14:56:17 UTC

New maven convention archetype

Hi,

Could someone try to test a new archetype which base on Convention
plugin and tell why it isn't working as expected? Index action is not
mapped and I18N is missing (properties files are where they should be
:-( )

mvn archetype:generate -DarchetypeCatalog=http://www.lenart.org.pl/maven/


Regards
-- 
Lukasz
http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: New maven convention archetype

Posted by Lukasz Lenart <lu...@googlemail.com>.
Ok, I made some minor tweaks and right now everything should be as
expected, please test it. Then I will register new Task with Jira ;-)


Regards
-- 
Lukasz
http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: New maven convention archetype

Posted by Musachy Barroso <mu...@gmail.com>.
lol. I hadn't thought of that, no package, no subdir required, clever ;)

musachy

On Wed, Apr 8, 2009 at 11:16 AM, Lukasz Lenart
<lu...@googlemail.com> wrote:
> 2009/4/8 Musachy Barroso <mu...@gmail.com>:
>> no, that would just instruct convention to scan from that package
>> down, what you need to do (I have no idea how archetypes work), is to
>> get the package name, and substring from "actions.", replace "." by
>> "/" and that will be the path under WEB-INF/content. If you can't
>> determine were to put the files at runtime, then you can either 1)
>> don't let users pick the package, 2) use @Result annotations to
>> indicate where the results are (kind of defeating the purpose of using
>> Convention)
>
> I found the solution, but this is weird. I just moved the classes to
> package named "actions" and it works!
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: New maven convention archetype

Posted by Lukasz Lenart <lu...@googlemail.com>.
2009/4/8 Musachy Barroso <mu...@gmail.com>:
> no, that would just instruct convention to scan from that package
> down, what you need to do (I have no idea how archetypes work), is to
> get the package name, and substring from "actions.", replace "." by
> "/" and that will be the path under WEB-INF/content. If you can't
> determine were to put the files at runtime, then you can either 1)
> don't let users pick the package, 2) use @Result annotations to
> indicate where the results are (kind of defeating the purpose of using
> Convention)

I found the solution, but this is weird. I just moved the classes to
package named "actions" and it works!


Regards
-- 
Lukasz
http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: New maven convention archetype

Posted by Musachy Barroso <mu...@gmail.com>.
no, that would just instruct convention to scan from that package
down, what you need to do (I have no idea how archetypes work), is to
get the package name, and substring from "actions.", replace "." by
"/" and that will be the path under WEB-INF/content. If you can't
determine were to put the files at runtime, then you can either 1)
don't let users pick the package, 2) use @Result annotations to
indicate where the results are (kind of defeating the purpose of using
Convention)

musachy

On Wed, Apr 8, 2009 at 10:24 AM, Lukasz Lenart
<lu...@googlemail.com> wrote:
> 2009/4/8 Musachy Barroso <mu...@gmail.com>:
>> The archetype is generating the jsps in the wrong location, it is
>> missing the namespace in the patch. For example, if I enter
>> "actions.test" for the package, the jsp is generated as
>> WEB-INF/content/hello.jsp, it should be WEB-INF/content/test/hello.jsp
>
> Archetype will setup actions.test as a basePackage in struts.xml, it
> should be ok then?
>
> <constant name="struts.convention.package.locators.basePackage"
> value="${package}"/>
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: New maven convention archetype

Posted by Lukasz Lenart <lu...@googlemail.com>.
2009/4/8 Musachy Barroso <mu...@gmail.com>:
> The archetype is generating the jsps in the wrong location, it is
> missing the namespace in the patch. For example, if I enter
> "actions.test" for the package, the jsp is generated as
> WEB-INF/content/hello.jsp, it should be WEB-INF/content/test/hello.jsp

Archetype will setup actions.test as a basePackage in struts.xml, it
should be ok then?

<constant name="struts.convention.package.locators.basePackage"
value="${package}"/>


Regards
-- 
Lukasz
http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: New maven convention archetype

Posted by Musachy Barroso <mu...@gmail.com>.
The archetype is generating the jsps in the wrong location, it is
missing the namespace in the patch. For example, if I enter
"actions.test" for the package, the jsp is generated as
WEB-INF/content/hello.jsp, it should be WEB-INF/content/test/hello.jsp

musachy

On Wed, Apr 8, 2009 at 8:56 AM, Lukasz Lenart
<lu...@googlemail.com> wrote:
> Hi,
>
> Could someone try to test a new archetype which base on Convention
> plugin and tell why it isn't working as expected? Index action is not
> mapped and I18N is missing (properties files are where they should be
> :-( )
>
> mvn archetype:generate -DarchetypeCatalog=http://www.lenart.org.pl/maven/
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org