Skip to main content

Deploying swc library in repository and adding maven artifacts for that

We can either deploy the swc file on a web server or a local Maven repository.
  1. To deploy xyz.swc on a webserver, the command is (in the folder containing xyz.swc):
    mvn deploy:deploy-file -Dfile=xyz.swc -Durl=file:///path/to/repository -DgroupId=com.abc -DartifactId=xyz -Dversion=1.01 -Dpackaging=swc
    
    This deploys the xyz.swc file to /path/to/repository (using the groupId, artifactId, version).
    Users then can refer to this Web URL (by defining a repository in their Maven project) and use xyz as a dependency in their Maven projects.
  2. To deploy the swc in a local Maven repository, we can execute (in the folder containing xyz.swc):
    mvn install:install-file -Dfile=xyz.swc -DgroupId=com.abc -DartifactId=xyz -Dversion=1.01 -Dpackaging=swc -DgeneratePom=true -DcreateChecksum=true
    
    Users then can add the dependency in the pom.xml file under <project> tag as:
        <dependencies>
            <dependency>
                <groupId>com.abc</groupId>
                <artifactId>xyz</artifactId>
                <version>1.01</version>
                <type>swc</type>
            </dependency>
        </dependencies>

Comments