Ecmarchitect: Working with Custom content types in Alfresco - Part 3

cancel
Showing results for 
Search instead for 
Did you mean: 
idebonis
Active Member II

Ecmarchitect: Working with Custom content types in Alfresco - Part 3

Jump to solution

Hello everybody!

I'm planning on completing the tutorials, but I can't get past this part. I also just picked up maven and I'm just a beginner. I'm working with the Alfresco SDK 4.1.0 allinone on ubuntu 18.04.

I don't understand what means a "sibling folder". Anyways, I created my content-tutorial-cmis  directory as follow:

Parent directory
├── content-tutorial
└── content-tutorial-cmis

When running the command:

mvn exec:java \
-Dexec.mainClass="com.someco.cmis.examples.SomeCoCMISDataCreator" \
-Dexec.args="admin admin SomeCo whitepaper test"

I get the error:

[ERROR] Failed to execute goal on project content-tutorial-cmis: Could not resolve dependencies for project com.someco:content-tutorial-cmis:jar:1.0-SNAPSHOT: Could not find artifact com.someco:content-tutorial:jar:1.0-SNAPSHOT -> [Help 1]

I believe the cause is that content-tutorial-cmis pom.xml doesn't  properly define  the dependency to the sibling project, or that the project was created in the wrong directory.

Can you please help me fix this error?

1 Solution

Accepted Solutions
idebonis
Active Member II

Re: Ecmarchitect: Working with Custom content types in Alfresco - Part 3

Jump to solution

Thanks everybody for your attention. The issue was finally solved thanks to @jpotts . 

The dependency issue is solved when replacing the content-tutorial dependency in content-tutorial-cmis pom.xml with this one:

<dependency>
   <groupId>com.someco</groupId>
   <artifactId>content-tutorial-platform</artifactId>
   <version>1.0-SNAPSHOT</version>
   <type>jar</type>
</dependency>

Regards,

Ignacio

View solution in original post

7 Replies
openpj
Moderator
Moderator

Re: Ecmarchitect: Working with Custom content types in Alfresco - Part 3

Jump to solution

Maven doesn't find the JAR including the compiled code.

Probably you only need to build and package your project, try to execute the following before that command:

mvn clean install

 

EddieMay
Alfresco Employee

Re: Ecmarchitect: Working with Custom content types in Alfresco - Part 3

Jump to solution

Hi @idebonis 

A 'sibling folder' is two or more folders/directories on the same level that share the same parent. So they are brothers &/or sisters (siblings).

    parent-folder

               |

folderA    folderB

So the file path would look something like this:

documentLibrary > parent-folder > folderA

documentLibrary > parent-folder > folderB

 

HTH

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
idebonis
Active Member II

Re: Ecmarchitect: Working with Custom content types in Alfresco - Part 3

Jump to solution
@EddieMay wrote:

Hi @idebonis 

A 'sibling folder' is two or more folders/directories on the same level that share the same parent. So they are brothers &/or sisters (siblings).


Thanks @EddieMay , although the error still persist, it's much clear now. 

The tutorial indicates to start a project "content-tutorial" in part 1, but in part 3 it says to make a sibling folder for the project "content-tutorial-cmis".  So, I need to setup a maven project  in the parent directory that links both of them? How could I do that?

Or do I need to put the "content-tutorial-cmis" project in the "content-tutorial" project directory?

Thanks @openpj for your reply, I already ran the comamnd several times, so I believe that the problem radicates in a poorly built maven project.

jpotts
Professional

Re: Ecmarchitect: Working with Custom content types in Alfresco - Part 3

Jump to solution

First, make sure you've done a "mvn clean install" on the content-tutorial project so that its build artifacts are in your local maven repository.

Next, change to the content-tutorial-cmis directory and run that build and it should complete without error.

If it does not, please open an issue and include the output of your mvn clean install so myself or others can debug it.

Thanks for reading the tutorial!

idebonis
Active Member II

Re: Ecmarchitect: Working with Custom content types in Alfresco - Part 3

Jump to solution

Thanks @jpotts  for your answer.

Truth be told, up until now I've been running "mvn clean install -DskipTests", since whenever I ran mvn clean install, I get the error:

[INFO] --- maven-failsafe-plugin:3.0.0-M1:integration-test (integration-test) @ content-tutorial-integration-tests ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.someco.platformsample.CustomContentModelIT
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.695 s <<< FAILURE! - in com.someco.platformsample.CustomContentModelIT
[ERROR] testCustomContentModelPresence(com.someco.platformsample.CustomContentModelIT)  Time elapsed: 0.687 s  <<< ERROR!
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Caused by: java.net.ConnectException: Connection refused (Connection refused)

[ERROR] testCreateAcmeDocument(com.someco.platformsample.CustomContentModelIT)  Time elapsed: 0.002 s  <<< ERROR!
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Caused by: java.net.ConnectException: Connection refused (Connection refused)

[INFO] Running com.someco.platformsample.HelloWorldWebScriptIT
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in com.someco.platformsample.HelloWorldWebScriptIT
[ERROR] testWebScriptCall(com.someco.platformsample.HelloWorldWebScriptIT)  Time elapsed: 0 s  <<< ERROR!
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
	at com.someco.platformsample.HelloWorldWebScriptIT.testWebScriptCall(HelloWorldWebScriptIT.java:67)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at com.someco.platformsample.HelloWorldWebScriptIT.testWebScriptCall(HelloWorldWebScriptIT.java:67)

[INFO] Running com.someco.platformsample.DemoComponentIT
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in com.someco.platformsample.DemoComponentIT
[ERROR] testChildNodesCount(com.someco.platformsample.DemoComponentIT)  Time elapsed: 0 s  <<< ERROR!
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Caused by: java.net.ConnectException: Connection refused (Connection refused)

[ERROR] testGetCompanyHome(com.someco.platformsample.DemoComponentIT)  Time elapsed: 0 s  <<< ERROR!
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
Caused by: java.net.ConnectException: Connection refused (Connection refused)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   CustomContentModelIT.testCreateAcmeDocument » HttpHostConnect Connect to local...
[ERROR]   CustomContentModelIT.testCustomContentModelPresence » HttpHostConnect Connect ...
[ERROR]   DemoComponentIT.testChildNodesCount » HttpHostConnect Connect to localhost:808...
[ERROR]   DemoComponentIT.testGetCompanyHome » HttpHostConnect Connect to localhost:8080...
[ERROR]   HelloWorldWebScriptIT.testWebScriptCall:67 » HttpHostConnect Connect to localh...
[INFO] 
[ERROR] Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-failsafe-plugin:3.0.0-M1:verify (verify-test) @ content-tutorial-integration-tests ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for AIO - SDK 4.0 1.0-SNAPSHOT:
[INFO] 
[INFO] AIO - SDK 4.0 ...................................... SUCCESS [  1.073 s]
[INFO] Alfresco Platform/Repository JAR Module ............ SUCCESS [ 12.933 s]
[INFO] Alfresco Share JAR Module .......................... SUCCESS [  1.503 s]
[INFO] Integration Tests Module ........................... FAILURE [  4.434 s]
[INFO] Alfresco Platform/Repository Docker Module ......... SKIPPED
[INFO] Alfresco Share Docker Module ....................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  20.055 s
[INFO] Finished at: 2021-07-15T19:12:29-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M1:verify (verify-test) on project content-tutorial-integration-tests: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/idebonis/Documents/Alfresco/2_Custom_Content_Types_Backup/content-tutorial/content-tutorial-integration-tests/target/failsafe-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[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/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :content-tutorial-integration-tests

Best regards,

Ignacio De Bonis

cristinamr
Advanced

Re: Ecmarchitect: Working with Custom content types in Alfresco - Part 3

Jump to solution

Hi @idebonis .

Check this post, I think you have there your solution.

Cheers,

Cristina.

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
idebonis
Active Member II

Re: Ecmarchitect: Working with Custom content types in Alfresco - Part 3

Jump to solution

Thanks everybody for your attention. The issue was finally solved thanks to @jpotts . 

The dependency issue is solved when replacing the content-tutorial dependency in content-tutorial-cmis pom.xml with this one:

<dependency>
   <groupId>com.someco</groupId>
   <artifactId>content-tutorial-platform</artifactId>
   <version>1.0-SNAPSHOT</version>
   <type>jar</type>
</dependency>

Regards,

Ignacio