Archetypes: Weld archetypes update
dan.j.allen Jun 15, 2010 2:08 AMIt's been a while and you might be wondering what's going on with the Weld archetypes. We are working on them, we've just been working upstream for a while.
From the very start, we've wanted to make the generated project as simple as possible, yet give you the maximum utility. For that to happen, you need the full Java EE API (or as much of it as the environment you are using will support). Rather than requiring you to put a dozen dependencies in your pom.xml, it would be ideal of you could bring it the platform APIs with a single dependency.
Here's what's brewing:
<dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-6.0</artifactId> <version>1.0.0.Beta4</version> <type>pom</type> <scope>provided</scope> </dependency>
You may be asking, what about the javaee-api JAR that's in the GlassFish repository. It's bad for two reasons:
- It's a shaded JAR, so you have no idea what it actually bundles
- The code is stripped out of all the method bodies, so you get an Absent Code exception if you try to touch any of the classes
Published stripped JARs was a bad decision in my viewpoint and I explain the resulting Absent Code Exception in an FAQ. Of course, you can just search for Absent Code
in Google and read all about the problems it's causing.
Another improvement in the archetypes are the repository definitions. The JBoss repository is now powered by Nexus and has become a hub for a catalog of other repositories, including central (though for users, it requires an addition to your settings.xml).
So the repository definitions now look like this (notice that the snapshots are intentionally disabled, minimizing bandwidth usage):
<repositories> <repository> <id>jboss-public-repository</id> <name>JBoss Repository</name> <url>https://repository.jboss.org/nexus/content/groups/public</url> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public-repository</id> <name>JBoss Repository</name> <url>https://repository.jboss.org/nexus/content/groups/public</url> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories>
Finally, I'm thinking that we should change how the archetypes are stored in the source repository. Right now we are using the archetype structure. However, it seems that the recommend way to create archetypes is from an project. So you store the final project in the source repository and then generate the Maven archetype from that structure.
You can read the documentation for the archetype:create-from-project goal for details, or check out this article which provides an example. I've followed this approach for the Arquillian archetypes. Steven, WDYT?
I'm also going to prefix archetype discussions with Archetypes: so that they stand out from discussion of Weld itself.