1

I am creating the new device from the documentation provided in this link (https://github.com/wso2/carbon-device-mgt-maven-plugin.git).

I performed the following steps

Step 1: Installing the Maven Archetype. Everything went okay! The maven archtype installed was

git clone -b v1.0.0 --single-branch https://github.com/wso2/carbon-device-mgt-maven-plugin.git

In Step 2: Creating a new device type, when I perform the command mvn archetype: generate -DarchetypeCatalog = local. The output does not show me the archetype for me to choose. Look at the output of this command:

C:\Users\eliazar.carvalho\Documents\Tools\WSO2\wso2iot-3.0.0\samples>mvn archetype:generate -DarchetypeCatalog=local
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------------------------------------------------    ---
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.0:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.0:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.0.0:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
Your filter doesn't match any archetype (hint: enter to return to initial list)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): :

What could be going wrong?

I am using WSO2 IoT Server 3.0 and OS: Ubuntu 14.04 LTS

Community
  • 1
  • 1
eliazarcs
  • 11
  • 3

2 Answers2

2

I also faced the same issue. This is how I fixed it.

mvn archetype:generate -DarchetypeCatalog=local -X

Will give you the exact local catalog file path it is being read. For me it was ~/.m2/repository/archetype-catalog.xml.

But actualy my local repo catalog file is on ~/.m2/archetype-catalog.xml. So I copied archetype-catalog.xml into the correct path with following command.

cp ~/.m2/archetype-catalog.xml ~/.m2/repository/

Now it works fine. It seems we need to update maven-archetype-plugin version in mentioned repository.

Govinnage Rasika Perera
  • 2,134
  • 1
  • 21
  • 33
  • Thank you! It worked. But I realized that only one archetype is made available, unlike the documentation that lists 4 different archetypes. Archetypes made available to me 1: location -> org.wso2.cdmf.devicetype: cdmf-devicetype-archetype (WSO2 CDMF Device Type Archetype) Could you tell me why? – eliazarcs Mar 30 '17 at 20:16
  • That's because you don't have built those repos thus local catalog will not contain those archetypes. BTW for generating a new device type we are only interested in org.wso2.cdmf.devicetype: cdmf-devicetype-archetype archetype. – Govinnage Rasika Perera Apr 03 '17 at 02:24
1

WSO2 IoT 3.1.0 is released and it includes 3 ways of introducing a new device type.

  1. Writing Java Extension using maven archetype
  2. Descriptor based model
  3. API based model

Please refer more information here

Vishanth
  • 1,320
  • 3
  • 14
  • 26