cancel
Showing results for 
Search instead for 
Did you mean: 

Build issue with alfresco-community-share

vitthal_bagal
Champ in-the-making
Champ in-the-making

Tried to build alfresco-community-share source with java 11 and maven 3.6.0 but mvn command(mvn clean install $AMPS -DskipTests=true -DskipTests -Dmaven.javadoc.skip=true -Pall-tas-tests -Pbuild-docker-images -Dimage.tag=latest -Drepo.image.tag=latest) failed with below error

[INFO] yui-common.js (3064636b)
[INFO] nb warnings: 0, nb errors: 0
[INFO]
[INFO] --- maven-war-plugin:2.6:war (default-war) @ share ---
[INFO] Packaging webapp
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Alfresco Share Parent 14.16:
[INFO]
[INFO] Alfresco Share Parent .............................. SUCCESS [ 2.233 s]
[INFO] Alfresco Web Framework common libraries ............ SUCCESS [ 17.219 s]
[INFO] Alfresco Share Encryption .......................... SUCCESS [ 1.124 s]
[INFO] Alfresco Share WAR ................................. FAILURE [ 29.031 s]
[INFO] Alfresco Web Editor Plugin ......................... SKIPPED
[INFO] Alfresco Web Editor ................................ SKIPPED
[INFO] Alfresco Web Editor Samples ........................ SKIPPED
[INFO] Alfresco WCMQS Parent .............................. SKIPPED
[INFO] Alfresco WCMQS Client API .......................... SKIPPED
[INFO] Alfresco WCMQS AMP ................................. SKIPPED
[INFO] Alfresco WCMQS Share AMP ........................... SKIPPED
[INFO] Alfresco WCMQS Web ................................. SKIPPED
[INFO] Packaging Alfresco Share ........................... SKIPPED
[INFO] Distribution of Alfresco Share ..................... SKIPPED
[INFO] Alfresco WebEditor Distribution Zip ................ SKIPPED
[INFO] Alfresco WCMQS Distribution Zip .................... SKIPPED
[INFO] Alfresco Share Docker Image Builder ................ SKIPPED
[INFO] alfresco-share-tests ............................... SKIPPED
[INFO] AMPs ............................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 52.042 s
[INFO] Finished at: 2021-11-29T07:03:56Z
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "local" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.6:war (default-war) on project share: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.6:war failed: Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
[ERROR] ---- Debugging information ----
[ERROR] message : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
[ERROR] cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
[ERROR] cause-message : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor
[ERROR] class : org.apache.maven.plugin.war.util.WebappStructure
[ERROR] required-type : org.apache.maven.plugin.war.util.WebappStructure
[ERROR] path : /webapp-structure
[ERROR] -------------------------------
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :share
root@98e8b75a4f48:~/alfresco-community-share#

Environment

root@06fd41ebdb04:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@06fd41ebdb04:~# java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.18.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.18.04, mixed mode, sharing)
root@06fd41ebdb04:~# mvn --version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.11, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.15.0-161-generic", arch: "amd64", family: "unix"
root@06fd41ebdb04:~#


Steps followed:

git clone https://github.com/Alfresco/alfresco-community-share.git
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
cd alfresco-community-share/
mvn clean install $AMPS -DskipTests=true -DskipTests -Dmaven.javadoc.skip=true -Pall-tas-tests -Pbuild-docker-images -Dimage.tag=latest -Drepo.image.tag=latest


Tried changing versions for war plugin, mvn and java but failure still observed. 

Anyone has observed such build issue before ? Am I missing something ? Please suggest 

4 REPLIES 4

vitthal_bagal
Champ in-the-making
Champ in-the-making

@abhinavmishra14 Am I missing any step ? Do I need to use any perticular version of maven or java to fix this issue. Please suggest. 

Thanks...

The issue you are facing is similar to this thread @vitthal_bagal 

Please review this thread and solutions:

https://hub.alfresco.com/t5/alfresco-content-services-forum/building-share-6-2-1-fails/td-p/299542 

Also share the maven settings.xml after you try the solutions provided in above thread if issue still persists

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

So to test i just tried the same steps as yours. Except the maven command. I don't see them documented anywhere on latest repo.

I also noticed that you are passing this "-DskipTests " twice and one no values set. Another issue with your command is that "-Pall-tas-tests" profile doesn't even exist.

I would suggest you rather just use following command as stated in other solved threads and it works.

Build result after i ran the above given command today:

git clone https://github.com/Alfresco/alfresco-community-share.git
cd alfresco-community-share
mvn clean package -DskipTests=true

OR -- to build docker images as well::

mvn clean package -DskipTests=true -Pbuild-docker-images -Dimage.tag=latest
[INFO] Building tar: C:\alfresco-community-share\packaging\docker\target\docker\alfresco\alfresco-share-base\latest\tmp\docker-build.tar
[INFO] DOCKER> [alfresco/alfresco-share-base:latest]: Created docker-build.tar in 20 seconds
[INFO] DOCKER> Credentials helper reply for "docker-credential-desktop" is 0.6.4
[INFO] DOCKER> Pulling from alfresco/alfresco-base-tomcat
2d473b07cdd5: Pull complete
e681b5eaa471: Pull complete
5ed1ff1abe72: Pull complete
3a3a139eac71: Pull complete
aa77360f5ba4: Pull complete
[INFO] DOCKER> Digest: sha256:5f0e64bccd717436b6afb905191ebbf18c1453149274de10e0547e3a261bfccf
[INFO] DOCKER> Status: Downloaded newer image for alfresco/alfresco-base-tomcat:9.0.52-java-11-centos-7
[INFO] DOCKER> Pulled alfresco/alfresco-base-tomcat:9.0.52-java-11-centos-7 in 1 minute and 5 seconds
[INFO] DOCKER> Step 1/18 : FROM alfresco/alfresco-base-tomcat:9.0.52-java-11-centos-7
[INFO] DOCKER>
[INFO] DOCKER> ---> ff357785af16
[INFO] DOCKER> Step 2/18 : RUN mkdir -p /usr/local/tomcat/shared/classes/alfresco/web-extension
[INFO] DOCKER>
[INFO] DOCKER> ---> Running in c3e10bd9c5cc
[INFO] DOCKER> Removing intermediate container c3e10bd9c5cc
[INFO] DOCKER> ---> 96312bb24766
[INFO] DOCKER> Step 3/18 : RUN mkdir -p /usr/local/tomcat/amps_share
[INFO] DOCKER>
[INFO] DOCKER> ---> Running in 4ff1819edc8f
[INFO] DOCKER> Removing intermediate container 4ff1819edc8f
[INFO] DOCKER> ---> f17307749d76
[INFO] DOCKER> Step 4/18 : RUN mkdir /licenses
[INFO] DOCKER>
[INFO] DOCKER> ---> Running in 2c9c58732060
[INFO] DOCKER> Removing intermediate container 2c9c58732060
[INFO] DOCKER> ---> 82cb9de74aa0
[INFO] DOCKER> Step 5/18 : COPY target/war /usr/local/tomcat/webapps
[INFO] DOCKER>
[INFO] DOCKER> ---> 554ffeecb69e
[INFO] DOCKER> Step 6/18 : COPY target/alfresco-mmt/* /usr/local/tomcat/alfresco-mmt/
[INFO] DOCKER>
[INFO] DOCKER> ---> 43001eab1a6b
[INFO] DOCKER> Step 7/18 : COPY target/amps_share /usr/local/tomcat/amps_share
[INFO] DOCKER>
[INFO] DOCKER> ---> fc51394e6c34
[INFO] DOCKER> Step 8/18 : COPY target/classes/web-extension-samples/share-config-custom.xml /usr/local/tomcat/shared/classes/alfresco/web-extension
[INFO] DOCKER>
[INFO] DOCKER> ---> 1ae5e9c6cc48
[INFO] DOCKER> Step 9/18 : COPY target/classes/web-extension-samples/custom-slingshot-application-context.xml.sample /usr/local/tomcat/shared/classes/alfresco/web-extension
[INFO] DOCKER>
[INFO] DOCKER> ---> ea2bbad6fe57
[INFO] DOCKER> Step 10/18 : COPY target/classes/web-extension-samples/smartfolders-amp-actions-config.xml /usr/local/tomcat/shared/classes/alfresco/web-extension
[INFO] DOCKER>
[INFO] DOCKER> ---> 9d45eba13d92
[INFO] DOCKER> Step 11/18 : COPY target/licenses/* /licenses/
[INFO] DOCKER>
[INFO] DOCKER> ---> 5c1d5c8dcf9b
[INFO] DOCKER> Step 12/18 : RUN sed -i "s/shared.loader=/shared.loader=\${catalina.base}\/shared\/classes/" /usr/local/tomcat/conf/catalina.properties
[INFO] DOCKER>
[INFO] DOCKER> ---> Running in 28f1d78ddee4
[INFO] DOCKER> Removing intermediate container 28f1d78ddee4
[INFO] DOCKER> ---> c3dc35ff286c
[INFO] DOCKER> Step 13/18 : COPY substituter.sh /usr/local/tomcat/shared/classes/alfresco
[INFO] DOCKER>
[INFO] DOCKER> ---> a7f4bc579c28
[INFO] DOCKER> Step 14/18 : RUN chmod +x /usr/local/tomcat/shared/classes/alfresco/substituter.sh
[INFO] DOCKER>
[INFO] DOCKER> ---> Running in 820a65bc0118
[INFO] DOCKER> Removing intermediate container 820a65bc0118
[INFO] DOCKER> ---> 5d0fd165da0b
[INFO] DOCKER> Step 15/18 : RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install               /usr/local/tomcat/amps_share /usr/local/tomcat/webapps/share -directory -nobackup -force
[INFO] DOCKER>
[INFO] DOCKER> ---> Running in d3a37e26a940
[INFO] DOCKER> Removing intermediate container d3a37e26a940
[INFO] DOCKER> ---> 0560ba377430
[INFO] DOCKER> Step 16/18 : ENTRYPOINT ["/usr/local/tomcat/shared/classes/alfresco/substituter.sh", "catalina.sh run"]
[INFO] DOCKER>
[INFO] DOCKER> ---> Running in 1884b7f8202d
[INFO] DOCKER> Removing intermediate container 1884b7f8202d
[INFO] DOCKER> ---> b522b27100aa
[INFO] DOCKER> Step 17/18 : EXPOSE 8000
[INFO] DOCKER>
[INFO] DOCKER> ---> Running in e23d7816b3cc
[INFO] DOCKER> Removing intermediate container e23d7816b3cc
[INFO] DOCKER> ---> c8e4626888c1
[INFO] DOCKER> Step 18/18 : LABEL quay.expires-after=1w
[INFO] DOCKER>
[INFO] DOCKER> ---> Running in caca2ba33922
[INFO] DOCKER> Removing intermediate container caca2ba33922
[INFO] DOCKER> ---> d4262d60876e
[INFO] DOCKER> Successfully built d4262d60876e
[INFO] DOCKER> Successfully tagged alfresco/alfresco-share-base:latest
[INFO] DOCKER> [alfresco/alfresco-share-base:latest]: Built image sha256:d4262
[INFO]
[INFO] -----------------< org.alfresco:alfresco-share-tests >------------------
[INFO] Building alfresco-share-tests 14.38-SNAPSHOT                     [18/19]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ alfresco-share-tests ---
[INFO] Deleting C:\alfresco-community-share\packaging\tests\target
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforcer) @ alfresco-share-tests ---
[INFO]
[INFO] --- properties-maven-plugin:1.0.0:read-project-properties (read-alfresco-global-properties) @ alfresco-share-tests ---
[INFO] Quiet processing - ignoring properties cannot be loaded from File: C:\alfresco-community-share\packaging\tests\..\tomcat\shared\classes\alfresco-global.properties
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (set-default-db-props-on-initialize) @ alfresco-share-tests ---
[INFO] Executing tasks

main:
[INFO] Executed tasks
[INFO]
[INFO] --- license-maven-plugin:2.0.1.alfresco-1:add-third-party (third-party-licenses) @ alfresco-share-tests ---
[WARNING] The goal is skip due to packaging 'pom'
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-test-resource (add-shared-classes) @ alfresco-share-tests ---
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:test-jar (create-test-jar) @ alfresco-share-tests ---
[INFO] Skipping packaging of the test-jar
[INFO]
[INFO] ------------------< org.alfresco:alfresco-share-amps >------------------
[INFO] Building AMPs 14.38-SNAPSHOT                                     [19/19]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ alfresco-share-amps ---
[INFO] Deleting C:\alfresco-community-share\amps\target
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforcer) @ alfresco-share-amps ---
[INFO]
[INFO] --- properties-maven-plugin:1.0.0:read-project-properties (read-alfresco-global-properties) @ alfresco-share-amps ---
[INFO] Quiet processing - ignoring properties cannot be loaded from File: C:\alfresco-community-share\amps\..\tomcat\shared\classes\alfresco-global.properties
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (set-default-db-props-on-initialize) @ alfresco-share-amps ---
[INFO] Executing tasks

main:
[INFO] Executed tasks
[INFO]
[INFO] --- license-maven-plugin:2.0.1.alfresco-1:add-third-party (third-party-licenses) @ alfresco-share-amps ---
[WARNING] The goal is skip due to packaging 'pom'
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-test-resource (add-shared-classes) @ alfresco-share-amps ---
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:test-jar (create-test-jar) @ alfresco-share-amps ---
[INFO] Skipping packaging of the test-jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Alfresco Share Parent 14.38-SNAPSHOT:
[INFO]
[INFO] Alfresco Share Parent .............................. SUCCESS [ 42.571 s]
[INFO] Alfresco Web Framework common libraries ............ SUCCESS [02:59 min]
[INFO] Alfresco Share Encryption .......................... SUCCESS [  1.719 s]
[INFO] Alfresco Share WAR ................................. SUCCESS [04:24 min]
[INFO] Alfresco Web Editor Plugin ......................... SUCCESS [  7.394 s]
[INFO] Alfresco Web Editor ................................ SUCCESS [ 35.508 s]
[INFO] Alfresco Web Editor Samples ........................ SUCCESS [  3.980 s]
[INFO] Alfresco WCMQS Parent .............................. SUCCESS [  0.380 s]
[INFO] Alfresco WCMQS Client API .......................... SUCCESS [  4.668 s]
[INFO] Alfresco WCMQS AMP ................................. SUCCESS [ 14.799 s]
[INFO] Alfresco WCMQS Share AMP ........................... SUCCESS [  1.766 s]
[INFO] Alfresco WCMQS Web ................................. SUCCESS [ 33.957 s]
[INFO] Packaging Alfresco Share ........................... SUCCESS [  0.453 s]
[INFO] Distribution of Alfresco Share ..................... SUCCESS [ 48.284 s]
[INFO] Alfresco WebEditor Distribution Zip ................ SUCCESS [  4.981 s]
[INFO] Alfresco WCMQS Distribution Zip .................... SUCCESS [  6.646 s]
[INFO] Alfresco Share Docker Image Builder ................ SUCCESS [04:22 min]
[INFO] alfresco-share-tests ............................... SUCCESS [  0.390 s]
[INFO] AMPs ............................................... SUCCESS [  0.254 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  15:17 min
[INFO] Finished at: 2021-12-27T15:22:43-05:00
[INFO] ------------------------------------------------------------------------

Make sure you have appropriate maven settings.xml to build the community version. Here is one for reference:

<?xml version="1.0" encoding="UTF-8"?>
<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">
	<!-- Default: ${user.home}/.m2/repository -->
	<!--<localRepository>C:\Maven\repository</localRepository>-->
	<pluginGroups>
	   <pluginGroup>net.thucydides.maven.plugins</pluginGroup>
	</pluginGroups>
	<servers>		
	</servers>
	<profiles>	
		<profile>
			<id>alfresco</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<repositories>
				<repository>
					<id>central</id>
					<url>https://repo1.maven.org/maven2/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</repository>
				<repository>
					<id>alfresco-public</id>
	<url>http://maven.alfresco.com/nexus/content/groups/public/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</repository>
				<repository>
					<id>alfresco-public-snapshots</id>
					<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
					<snapshots>
						<enabled>true</enabled>
						<updatePolicy>daily</updatePolicy>
					</snapshots>
				</repository>
			</repositories>
			<pluginRepositories>
				<pluginRepository>
					<id>central</id>
					<url>https://repo1.maven.org/maven2/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</pluginRepository>
				<pluginRepository>
					<id>alfresco-public</id>
					<url>http://maven.alfresco.com/nexus/content/groups/public/</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</pluginRepository>
				<pluginRepository>
					<id>alfresco-plugin-public</id>
					<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
				</pluginRepository>
				<pluginRepository>
					<id>alfresco-plugin-public-snapshots</id>
					<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
					<snapshots>
						<enabled>true</enabled>
						<updatePolicy>daily</updatePolicy>
					</snapshots>
				</pluginRepository>
			</pluginRepositories>
		</profile>
	</profiles>
	<activeProfiles>
		<activeProfile>alfresco</activeProfile>
	</activeProfiles>
</settings>
~Abhinav
(ACSCE, AWS SAA, Azure Admin)

Hello, I have this profile and i did the same steps however I am getting following error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.6:war (default-war) on project share: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.6:war failed: Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor : Cannot construct org.apache.maven.plugin.war.util.WebappStructure as it does not have a no-args constructor

Maven -version

Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.15.1, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-11
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-60-generic", arch: "amd64", family: "unix"

Maven War Plugin version: 2.6