Alfresco / alfresco-sdk

The Alfresco In-Process SDK is based on Apache Maven, includes support for rapid and standard development, testing, packaging, versioning and release of your Alfresco integration and extension projects
Apache License 2.0
186 stars 113 forks source link

Feature to run Alfresco & Share in different tomcat instances #486

Closed shazada closed 3 years ago

shazada commented 6 years ago

to get this working I've done the following:

  1. Created my own archetype
  2. Changed the share pom.xml with the following:
<properties>
        <maven.tomcat.port>8081</maven.tomcat.port>
    </properties>
<plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
            </plugin>
            <!-- The Alfresco Maven Plugin contains all the logic to run the extension in an embedded Tomcat with the H2 database. -->
            <plugin>
                <groupId>org.alfresco.maven.plugin</groupId>
                <artifactId>alfresco-maven-plugin</artifactId>
                <version>${alfresco.sdk.version}</version>
                <configuration>

                    <!-- We need the flat file H2 database to run the Repo -->
                    <enableH2>false</enableH2>
                    <!-- We always need the Platform/Repo webapp - alfresco.war -->
                    <enablePlatform>false</enablePlatform>
                    <!-- Enable Solr webapp so we can use search -->
                    <enableSolr>false</enableSolr>
                    <!-- We need Share webapp, so we got a UI for working with the Repo -->
                    <enableShare>true</enableShare>
                    <!-- Enable the REST API Explorer -->
                    <enableApiExplorer>false</enableApiExplorer>

                    <!-- JARs and AMPs that should be overlayed/applied to the Share WAR (i.e. share.war) -->
                    <shareModules>
                        <!-- Bring in custom Modules -->
                        <moduleDependency>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>contezza-case-collaboration-share</artifactId>
                            <version>${project.version}</version>
                        </moduleDependency>
                    </shareModules>
                </configuration>
            </plugin>
        </plugins>
  1. Changed the major pom.xml and set enableShare to false.
  2. Copied the test/resources/share to share project
  3. run mvn install alfresco:run on major pom. And the same but on the share project.
binduwavell commented 6 years ago

@shazada, it should be possible to do this with SDK 3 and an all-in-one project by making two invocations of run.sh with arguments to disable share or platform/SOLR and to update the port for the share instance. I don’t think Pom changes should be required.

shazada commented 6 years ago

I'll give it a try!

shazada commented 6 years ago

The configuration needs to be a variable otherwise it can't be picked up on the command line. Other wise create 2 profiles and override there the config one for Platform and the other one for Share