You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sam Wun <sw...@gmail.com> on 2009/07/08 05:18:13 UTC
Re: Unable to add module to the current project as it is not of
packaging type 'pom' - Was: Detected Maven Version: 2.1.0 is not in the
allowed range
ok Fixed.
thanks very much for that.
Sam
On Wed, Jul 8, 2009 at 12:34 PM, Edelson,
Justin<Ju...@mtvstaff.com> wrote:
> That error message means what it says - you can't create a sub-project of a project which doesn't have a packaging of pom. When you run the archetype:generate goal and Maven sees that there's a existing project in the current directory, it assumes you are trying to create a sub-project (module). If this isn't your intention, then your current working directory shouldn't contain a Maven pom.
>
> Justin
>
> ________________________________
>
> From: Sam Wun [mailto:swun2010@gmail.com]
> Sent: Tue 7/7/2009 10:19 PM
> To: Maven Users List
> Subject: Unable to add module to the current project as it is not of packaging type 'pom' - Was: Detected Maven Version: 2.1.0 is not in the allowed range
>
>
>
> Hi, I got a further errors after added new codes in the pom.xml file.
> Please see below for more info.
> # cat pom.xml
> <?xml version="1.0" encoding="UTF-8"?>
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <!-- Model Version -->
> <modelVersion>4.0.0</modelVersion>
>
> <parent>
> <groupId>org.jboss.ejb3</groupId>
> <artifactId>jboss-ejb3-tutorial-common</artifactId>
> <version>1.1.1</version>
> <relativePath>../common/</relativePath>
> </parent>
>
> <properties>
> <ejb3.tutorial.client>org.jboss.tutorial.stateless.client.Client</ejb3.tutorial.client>
> </properties>
>
> <artifactId>jboss-ejb3-tutorial-stateless</artifactId>
> <version>1.1.1-SNAPSHOT</version>
> <packaging>jar</packaging>
> <name>EJB3.0 Stateless Bean Tutorial</name>
> <url>http://labs.jboss.com/jbossejb3/</url>
> <description>
> Tutorial for Stateless EJB 3.0
> </description>
>
> <repositories>
> <repository>
> <id>jboss-repositories</id>
> <url>http://repository.jboss.org/maven2/</url>
> </repository>
> </repositories>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-enforcer-plugin</artifactId>
> <version>1.0-beta-1</version>
> <executions>
> <execution>
> <id>enforce-banned-dependencies</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> </execution>
> <execution>
> <id>enforce-property</id>
> <phase>pre-integration-test</phase>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <requireProperty>
> <property>jboss.home</property>
> <message>"Please set JBOSS_HOME"</message>
> </requireProperty>
> </rules>
> <fail>true</fail>
> </configuration>
> </execution>
> </executions>
> <configuration>
> <rules>
> <bannedDependencies>
> <excludes>
> <exclude>jboss:jboss-common-core</exclude>
> <exclude>jboss:jboss-remoting</exclude>
> <exclude>jboss.remoting:jboss-remoting</exclude>
> <exclude>jboss:jboss-test</exclude>
> <exclude>org.jboss:javassist</exclude>
> <exclude>org.jboss:jboss-metadata</exclude>
> <exclude>org.jboss:jboss-transaction-spi</exclude>
> <exclude>org.jboss.microcontainer:jboss-container</exclude>
>
> <exclude>org.jboss.microcontainer:jboss-deployers-core-spi</exclude>
> <exclude>org.jboss.microcontainer:jboss-deployers-impl</exclude>
> <exclude>org.jboss.microcontainer:jboss-deployers-spi</exclude>
> </excludes>
> </bannedDependencies>
> <requireMavenVersion>
> <version>[2.1,2.2)</version>
> </requireMavenVersion>
> </rules>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> </project>
>
>
>
> Error:
> # mvn archetype:generate --batch-mode
> -DarchetypeArtifactId=maven-archetype-quickstart
> -DgroupId=uk.co.pookey.spring -DartifactId=spring-hello
> -Dversion=1.0-SNAPSHOT
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'archetype'.
> WAGON_VERSION: 1.0-beta-2
> [INFO] ------------------------------------------------------------------------
> [INFO] Building EJB3.0 Stateless Bean Tutorial
> [INFO] task-segment: [archetype:generate] (aggregator-style)
> [INFO] ------------------------------------------------------------------------
> [INFO] Preparing archetype:generate
> Downloading: http://repository.jboss.org/maven2//org/jboss/ws/native/jbossws-native-saaj/1.0-SNAPSHOT/jbossws-native-saaj-1.0-SNAPSHOT.pom
> [INFO] Unable to find resource
> 'org.jboss.ws.native:jbossws-native-saaj:pom:1.0-SNAPSHOT' in
> repository jboss-repositories (http://repository.jboss.org/maven2/)
> Downloading: http://snapshots.jboss.org/maven2/org/jboss/ws/native/jbossws-native-saaj/1.0-SNAPSHOT/jbossws-native-saaj-1.0-SNAPSHOT.pom
> [INFO] Unable to find resource
> 'org.jboss.ws.native:jbossws-native-saaj:pom:1.0-SNAPSHOT' in
> repository jboss-snapshots (http://snapshots.jboss.org/maven2)
> Downloading: http://snapshots.jboss.org/maven2/org/jboss/ws/native/jbossws-native-saaj/1.0-SNAPSHOT/jbossws-native-saaj-1.0-SNAPSHOT.pom
> [INFO] Unable to find resource
> 'org.jboss.ws.native:jbossws-native-saaj:pom:1.0-SNAPSHOT' in
> repository snapshots.jboss.org (http://snapshots.jboss.org/maven2)
> Downloading: http://download.java.net/maven/2//org/jboss/ws/native/jbossws-native-saaj/1.0-SNAPSHOT/jbossws-native-saaj-1.0-SNAPSHOT.pom
> [INFO] Unable to find resource
> 'org.jboss.ws.native:jbossws-native-saaj:pom:1.0-SNAPSHOT' in
> repository maven2.java.net (http://download.java.net/maven/2/)
> Downloading: http://download.java.net/maven/1//org.jboss.ws.native/poms/jbossws-native-saaj-1.0-SNAPSHOT.pom
> [INFO] Unable to find resource
> 'org.jboss.ws.native:jbossws-native-saaj:pom:1.0-SNAPSHOT' in
> repository java.net (http://download.java.net/maven/1/)
> [INFO] [enforcer:enforce {execution: enforce-banned-dependencies}]
> [INFO] Setting property: classpath.resource.loader.class =>
> 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
> [INFO] Setting property: velocimacro.messages.on => 'false'.
> [INFO] Setting property: resource.loader => 'classpath'.
> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
> [INFO] [archetype:generate]
> [INFO] Generating project in Batch mode
> [INFO] ----------------------------------------------------------------------------
> [INFO] Using following parameters for creating OldArchetype:
> maven-archetype-quickstart:1.0
> [INFO] ----------------------------------------------------------------------------
> [INFO] Parameter: groupId, Value: uk.co.pookey.spring
> [INFO] Parameter: packageName, Value: uk.co.pookey.spring
> [INFO] Parameter: package, Value: uk.co.pookey.spring
> [INFO] Parameter: artifactId, Value: spring-hello
> [INFO] Parameter: basedir, Value:
> /usr/java-source/ejb3-tutorial/source/stateless
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [ERROR] Unable to add module to the current project as it is not of
> packaging type 'pom'
> org.apache.maven.archetype.old.ArchetypeTemplateProcessingException:
> Unable to add module to the current project as it is not of packaging
> type 'pom'
> at org.apache.maven.archetype.old.DefaultOldArchetype.createArchetype(DefaultOldArchetype.java:308)
> at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processOldArchetype(DefaultArchetypeGenerator.java:253)
> at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:143)
> at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:286)
> at org.apache.maven.archetype.DefaultArchetype.generateProjectFromArchetype(DefaultArchetype.java:69)
>
>
> Thanks
> Sam
>
> On Tue, Jul 7, 2009 at 11:18 PM, Sam Wun<sw...@gmail.com> wrote:
>> As it running forward, near the end of the download.. there is an error:
>> ...
>> [INFO] [enforcer:enforce {execution: enforce-banned-dependencies}]
>> [WARNING] Rule 1:
>> org.apache.maven.plugins.enforcer.RequireMavenVersion failed with
>> message:
>> Detected Maven Version: 2.1.0 is not in the allowed range [2.0.9,2.1).
>> [INFO] ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO] ------------------------------------------------------------------------
>> [INFO] Some Enforcer rules have failed. Look above for specific
>> messages explaining why the rule failed.
>> [INFO] ------------------------------------------------------------------------
>> [INFO] For more information, run Maven with the -e switch
>> [INFO] ------------------------------------------------------------------------
>> [INFO] Total time: 9 minutes 20 seconds
>> [INFO] Finished at: Tue Jul 07 23:12:08 EST 2009
>> [INFO] Final Memory: 37M/63M
>> [INFO] ------------------------------------------------------------------------
>>
>> what is it?
>>
>> I have found someone got this error as well, but could not find an answer.
>>
>> Thanks
>>
>>
>> On Tue, Jul 7, 2009 at 11:04 PM, Sam Wun<sw...@gmail.com> wrote:
>>> lolz... as the page told me , it set it to settings.xml. :D
>>> it works now, thank you for the great help.
>>>
>>> On Tue, Jul 7, 2009 at 10:59 PM, Anders Hammar<an...@hammar.net> wrote:
>>>> That's because it should go in your pom.xml! The project tag is for the POM.
>>>>
>>>> Please have a look at the pom schema, as I wrote!
>>>>
>>>> /Anders
>>>>
>>>> On Tue, Jul 7, 2009 at 14:53, Sam Wun<sw...@gmail.com> wrote:
>>>>> I put it here:
>>>>> <settings xmlns="http://maven.apache.org/settings/1.0.0"
>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>> xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
>>>>> http://maven.apache.org/xsd/settings-1.0.0.xsd">
>>>>> <project>
>>>>> <repositories>
>>>>> <repository>
>>>>> <id>jboss-repositories</id>
>>>>> <url>http://repository.jboss.org/maven2/</url>
>>>>> </repository>
>>>>> </repositories>
>>>>> </project>
>>>>>
>>>>> but error when I executed the following mvn commandline:
>>>>>
>>>>> # mvn archetype:generate --batch-mode
>>>>> -DarchetypeArtifactId=maven-archetype-quickstart
>>>>> -DgroupId=uk.co.pookey.spring -DartifactId=spring-hello
>>>>> -Dversion=1.0-SNAPSHOT
>>>>> Error reading settings.xml: Unrecognised tag: 'project' (position:
>>>>> START_TAG seen ...S/1.0.0
>>>>> http://maven.apache.org/xsd/settings-1.0.0.xsd">\n<project>... @51:10)
>>>>> Line: 51
>>>>> Column: 10
>>>>>
>>>>>
>>>>> On Tue, Jul 7, 2009 at 10:41 PM, Anders Hammar<an...@hammar.net> wrote:
>>>>>> Don't add it in a profile (well, at least not for the normal case),
>>>>>> but exactly as specified in the page I linked to. Like this:
>>>>>>
>>>>>> <project>
>>>>>> ...
>>>>>> <repositories>
>>>>>> <repository>
>>>>>> <id>jboss-repo</id>
>>>>>> <url>http://repository.jboss.org/maven2/</url>
>>>>>> </repository>
>>>>>> </repositories>
>>>>>> ...
>>>>>> </project>
>>>>>>
>>>>>> Please check the pom schema!
>>>>>>
>>>>>> /Anders
>>>>>>
>>>>>> On Tue, Jul 7, 2009 at 14:11, Sam Wun<sw...@gmail.com> wrote:
>>>>>>> Sorry, I don't know where to put it in the settings.xml file.
>>>>>>> I put it in the following area, but got caused mvn errors:
>>>>>>>
>>>>>>>
>>>>>>> <profile>
>>>>>>> <id>jdk-1.4</id>
>>>>>>>
>>>>>>> <activation>
>>>>>>> <jdk>1.4</jdk>
>>>>>>> </activation>
>>>>>>>
>>>>>>> <repositories>
>>>>>>> <repository>
>>>>>>> <id>jdk14</id>
>>>>>>> <name>Repository for JDK 1.4 builds</name>
>>>>>>> <url>http://www.myhost.com/maven/jdk14</url>
>>>>>>> <layout>default</layout>
>>>>>>> <snapshotPolicy>always</snapshotPolicy>
>>>>>>> </repository>
>>>>>>> <repository>
>>>>>>> <id>jboss-repository</id>
>>>>>>> <url>http://repository.jboss.org/maven2/</url>
>>>>>>> </repository>
>>>>>>>
>>>>>>> </repositories>
>>>>>>>
>>>>>>> </profile>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Jul 7, 2009 at 9:53 PM, Sam Wun<sw...@gmail.com> wrote:
>>>>>>>> hehe Cool ^__^
>>>>>>>> and Thanks.
>>>>>>>>
>>>>>>>> On Tue, Jul 7, 2009 at 9:43 PM, Anders Hammar<an...@hammar.net> wrote:
>>>>>>>>> http://lmgtfy.com/?q=maven+add+remote+repository&l=1
>>>>>>>>>
>>>>>>>>> On Tue, Jul 7, 2009 at 13:32, Sam Wun<sw...@gmail.com> wrote:
>>>>>>>>>> Hi, how do you define http://repository.jboss.org/maven2/ with mvn?
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>>
>>>>>>>>>> On Tue, Jul 7, 2009 at 9:30 PM, Anders Hammar<an...@hammar.net> wrote:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> That artifact doesn't exist at central (aka repo1). Try jboss's
>>>>>>>>>>> repository instead:
>>>>>>>>>>> http://repository.jboss.org/maven2/
>>>>>>>>>>>
>>>>>>>>>>> /Anders
>>>>>>>>>>>
>>>>>>>>>>> On Tue, Jul 7, 2009 at 13:23, Sam Wun<sw...@gmail.com> wrote:
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> Can anyone tell me how to resolve this error:
>>>>>>>>>>>>
>>>>>>>>>>>> # mvn archetype:create-from-project
>>>>>>>>>>>> [INFO] Scanning for projects...
>>>>>>>>>>>> Downloading: http://repo1.maven.org/maven2/org/jboss/ejb3/jboss-ejb3-tutorial-common/1.1.1/jboss-ejb3-tutorial-common-1.1.1.pom
>>>>>>>>>>>> [INFO] Unable to find resource
>>>>>>>>>>>> 'org.jboss.ejb3:jboss-ejb3-tutorial-common:pom:1.1.1' in repository
>>>>>>>>>>>> central (http://repo1.maven.org/maven2)
>>>>>>>>>>>> [INFO] ------------------------------------------------------------------------
>>>>>>>>>>>> [ERROR] FATAL ERROR
>>>>>>>>>>>> [INFO] ------------------------------------------------------------------------
>>>>>>>>>>>> [INFO] Error building POM (may not be this project's POM).
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Project ID: null:jboss-ejb3-tutorial-stateless:jar:1.1.1-SNAPSHOT
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks
>>>>>>>>>>>> Sam
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org