You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "David F. Newman" <df...@exchange.mit.edu> on 2011/11/22 00:11:19 UTC

Maven archetype struts2-archetype-blank

Hi there,
So I've been trying to use the struts2-archetype-blank maven archetype 
to create a new project and it seems to generate a pom file that doesn't 
work out of the box.

I run:

$ mvn archetype:generate \
-DarchetypeGroupId=org.apache.struts \
-DarchetypeArtifactId=struts2-archetype-blank

Define value for property 'groupId': : edu.mit.dfn.testapp
Define value for property 'artifactId': : testapp
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  edu.mit.dfn.testapp: :
Confirm properties configuration:
groupId: edu.mit.dfn.testapp
artifactId: testapp
version: 1.0-SNAPSHOT
package: edu.mit.dfn.testapp
[INFO] Using following parameters for creating project from Archetype: 
struts2-archetype-blank:2.2.3

However trying to compile with "mvn compile" yields the following errors:

[ERROR]   The project edu.mit.dfn.testapp:testapp:${project.version} 
(/home/dfn/src/testapp/pom.xml) has 9 errors
[ERROR]     Resolving expression: '${project.version}': Detected the 
following recursive expression cycle in 'project.version': [version] -> 
[Help 2]
...
[ERROR]     'dependencies.dependency.version' for 
org.apache.struts:struts2-core:jar must be a valid version but is 
'${struts2.version}'. @ line 20, column 22
[ERROR]     'dependencies.dependency.version' for 
org.apache.struts:struts2-config-browser-plugin:jar must be a valid 
version but is '${struts2.version}'. @ line 26, column 22
[ERROR]     'dependencies.dependency.version' for 
org.apache.struts:struts2-junit-plugin:jar must be a valid version but 
is '${struts2.version}'. @ line 32, column 22

Looking at the pom.xml file I see

<version>${project.version}</version>
<properties>
<struts2.version>${project.version}</struts2.version>
</properties>

So I change it to
<version>1.0-SNAPSHOT</version>
<properties>
<struts2.version>2.2.3</struts2.version>
</properties>

And now everything works.  Has anyone else seen this and am I just doing 
something wrong?

-Dave
dfn@mit.edu


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


Re: Maven archetype struts2-archetype-blank

Posted by Jeff Black <je...@yahoo.com>.
Lukasz -- I'm not a Maven guru but I found this blog post that "may" be helpful:

http://intellectualcramps.wordpress.com/2011/04/15/maven-archetype-creation-tips/

Best,

jb





________________________________
 From: Łukasz Lenart <lu...@googlemail.com>
To: Struts Users Mailing List <us...@struts.apache.org> 
Sent: Wednesday, November 23, 2011 4:59 AM
Subject: Re: Maven archetype struts2-archetype-blank
 
2011/11/22 David F. Newman <df...@exchange.mit.edu>:
> Interesting.  That worked.  I had tried 2.2.3 and 2.2.3.1 with the same
> results.  I had not tried going back to earlier versions.  I'll stick with
> that version for now.

Ok, I solved that problem, but have one more. I would like to create
archetype-catalog.xml file during building a site, but I cannot figure
out how to filter archetype-catalog.xml to replace ${project.version}.
Any idea ?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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

Re: Maven archetype struts2-archetype-blank

Posted by Łukasz Lenart <lu...@googlemail.com>.
2011/11/22 David F. Newman <df...@exchange.mit.edu>:
> Interesting.  That worked.  I had tried 2.2.3 and 2.2.3.1 with the same
> results.  I had not tried going back to earlier versions.  I'll stick with
> that version for now.

Ok, I solved that problem, but have one more. I would like to create
archetype-catalog.xml file during building a site, but I cannot figure
out how to filter archetype-catalog.xml to replace ${project.version}.
Any idea ?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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


Re: Maven archetype struts2-archetype-blank

Posted by "David F. Newman" <df...@exchange.mit.edu>.
Interesting.  That worked.  I had tried 2.2.3 and 2.2.3.1 with the same 
results.  I had not tried going back to earlier versions.  I'll stick 
with that version for now.

Thank you
-Dave

On 11/21/11 7:03 PM, Dave Newton wrote:
> Appears to be an issue in 2.2.3; normally you'd want to explicitly specify
> -DarchetypeVersion (or at least I generally do). For 2.2.1 it works, for
> 2.2.3 the property isn't filled in.
>
> Dave
>
> On Mon, Nov 21, 2011 at 6:11 PM, David F. Newman<df...@exchange.mit.edu>wrote:
>
>> mvn archetype:generate \
>> -DarchetypeGroupId=org.apache.**struts \
>> -DarchetypeArtifactId=struts2-**archetype-blank
>>


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


Re: Maven archetype struts2-archetype-blank

Posted by Dave Newton <da...@gmail.com>.
Appears to be an issue in 2.2.3; normally you'd want to explicitly specify
-DarchetypeVersion (or at least I generally do). For 2.2.1 it works, for
2.2.3 the property isn't filled in.

Dave

On Mon, Nov 21, 2011 at 6:11 PM, David F. Newman <df...@exchange.mit.edu>wrote:

> mvn archetype:generate \
> -DarchetypeGroupId=org.apache.**struts \
> -DarchetypeArtifactId=struts2-**archetype-blank
>

Re: Maven archetype struts2-archetype-blank

Posted by Łukasz Lenart <lu...@googlemail.com>.
Could you register an issue about that ?

https://issues.apache.org/jira/browse/WW


Thanks in advance
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/


2011/11/22 David F. Newman <df...@exchange.mit.edu>:
> Hi there,
> So I've been trying to use the struts2-archetype-blank maven archetype to
> create a new project and it seems to generate a pom file that doesn't work
> out of the box.
>
> I run:
>
> $ mvn archetype:generate \
> -DarchetypeGroupId=org.apache.struts \
> -DarchetypeArtifactId=struts2-archetype-blank
>
> Define value for property 'groupId': : edu.mit.dfn.testapp
> Define value for property 'artifactId': : testapp
> Define value for property 'version':  1.0-SNAPSHOT: :
> Define value for property 'package':  edu.mit.dfn.testapp: :
> Confirm properties configuration:
> groupId: edu.mit.dfn.testapp
> artifactId: testapp
> version: 1.0-SNAPSHOT
> package: edu.mit.dfn.testapp
> [INFO] Using following parameters for creating project from Archetype:
> struts2-archetype-blank:2.2.3
>
> However trying to compile with "mvn compile" yields the following errors:
>
> [ERROR]   The project edu.mit.dfn.testapp:testapp:${project.version}
> (/home/dfn/src/testapp/pom.xml) has 9 errors
> [ERROR]     Resolving expression: '${project.version}': Detected the
> following recursive expression cycle in 'project.version': [version] ->
> [Help 2]
> ...
> [ERROR]     'dependencies.dependency.version' for
> org.apache.struts:struts2-core:jar must be a valid version but is
> '${struts2.version}'. @ line 20, column 22
> [ERROR]     'dependencies.dependency.version' for
> org.apache.struts:struts2-config-browser-plugin:jar must be a valid version
> but is '${struts2.version}'. @ line 26, column 22
> [ERROR]     'dependencies.dependency.version' for
> org.apache.struts:struts2-junit-plugin:jar must be a valid version but is
> '${struts2.version}'. @ line 32, column 22
>
> Looking at the pom.xml file I see
>
> <version>${project.version}</version>
> <properties>
> <struts2.version>${project.version}</struts2.version>
> </properties>
>
> So I change it to
> <version>1.0-SNAPSHOT</version>
> <properties>
> <struts2.version>2.2.3</struts2.version>
> </properties>
>
> And now everything works.  Has anyone else seen this and am I just doing
> something wrong?
>
> -Dave
> dfn@mit.edu
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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