[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-503) Generated archetype broken for any package name with dot (.) (Gustavo Fernandes)

Hardy Ferentschik (JIRA) noreply at atlassian.com
Tue May 4 05:42:42 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36872#action_36872 ] 

Hardy Ferentschik commented on HSEARCH-503:
-------------------------------------------

The changes I made included a move of the java classes into com.example. I also moved _archetype.properties_ out of the source directory since otherwise it was included into the artifact. In fact the following sequence of commands (as described in [Contributing in Hibernate Search|http://community.jboss.org/wiki/ContributingtoHibernateSearch]) works now:
{code}
# archetype creation
> cd hibernate-search-archetype
> mvn archetype:create-from-project -Darchetype.properties=archetype.properties
> cd target/generated-sources/archetype
> mvn install

# archetype usage against local catalog
> cd /tmp
> mvn archetype:generate -DarchetypeCatalog=local
{code}
However, I also had to set the groupId in the pom to _com.example_. Leaving the groupId as _org.hibernate_ screwed up the import statements in the archetype. What happens is that all in all import statements _org.hibernate_ gets replaced with whatever you specify during _archetype:generate_. The problem with _com.example_ is that the artifact gets deployed at the wrong spot in the repo.

On top of this it is at the moment not clear what happens with the archetype catalog. How and if it gets maintained on the new Jboss Maven repo. I added a comment regarding this issue [here|http://community.jboss.org/wiki/MavenGettingStarted-Developers].

Last but not least, I am getting more and more frustrated with the archetype plugin. Really the archetype needs its own packaging type. Right now I need a two step process to get the achetype deployed. I can not have an aggregator project where one module is the archetype which gets automatically deployed (as artifact!) when calling 'mvn install' or 'mvn deploy'. Currently there is always this additional step of 'mvn archetype:create-from-project; cd target/generated-sources/archetype; mvn install' From a release perspective this is a pita.

I'll resolve the issue, since the dot(.) problem is kind of resolved. We can visit the archetype generation/deployment at a later point in time.

> Generated archetype broken for any package name with dot (.) (Gustavo Fernandes)
> --------------------------------------------------------------------------------
>
>                 Key: HSEARCH-503
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-503
>             Project: Hibernate Search
>          Issue Type: Patch
>          Components: build
>    Affects Versions: 3.2.0.Beta1
>            Reporter: G Fernandes
>            Assignee: G Fernandes
>            Priority: Minor
>             Fix For: 3.2.0
>
>         Attachments: archetype.diff
>
>
> Steps to reproduce:
> =====================
> $ cd hibernate-search-archetype
> $ mvn archetype:create-from-project -Darchetype.properties=src/main/archetype/archetype.properties
> ...
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 4 seconds
> [INFO] Finished at: Sat Apr 10 20:35:58 BST 2010
> [INFO] Final Memory: 16M/80M
> [INFO] ------------------------------------------------------------------------
> $ cd target/generate-sources/archetype
> $ mvn install
> ...
> [INFO] BUILD SUCCESSFUL
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Sat Apr 10 20:36:50 BST 2010
> [INFO] Final Memory: 18M/80M
> [INFO] ------------------------------------------------------------------------
> $ cd ~/temp
> $ mvn archetype:generate  -DarchetypeGroupId=org.hibernate -DarchetypeArtifactId=hibernate-search-quickstart -DarchetypeVersion=3.2.0-SNAPSHOT -DgroupId=my.company -DartifactId=quickstart -Dversion=1.0-SNAPSHOT
> ...
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 5 seconds
> [INFO] Finished at: Sat Apr 10 20:39:17 BST 2010
> [INFO] Final Memory: 13M/79M
> [INFO] ------------------------------------------------------------------------
> $ cd quickstart
> $ mvn install
> [INFO] -------------------------------------------------------------
> [ERROR] COMPILATION ERROR : 
> [INFO] -------------------------------------------------------------
> [ERROR] /Users/gustavo/temp/quickstart/src/main/java/com/mycomany/Book.java:[25,11] ';' expected
> [ERROR] /Users/gustavo/temp/quickstart/src/main/java/com/mycomany/Book.java:[37,10] '.' expected
> [ERROR] /Users/gustavo/temp/quickstart/src/main/java/com/mycomany/Book.java:[37,11] ';' expected
> [ERROR] /Users/gustavo/temp/quickstart/src/main/java/com/mycomany/Book.java:[37,19] class, interface, or enum expected
> [ERROR] /Users/gustavo/temp/quickstart/src/main/java/com/mycomany/Book.java:[37,20] class, interface, or enum expected
> [ERROR] /Users/gustavo/temp/quickstart/src/main/java/com/mycomany/Author.java:[25,11] ';' expected

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list