Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Alfresco SDK 
2014/10/02 
Yoshihiko Aochi 
Solution Engineer, Alfresco Japan
Maven䛸䛿 
• http://maven.apache.org/ 
• 䝥䝻䝆䜵䜽䝖䛾⎔ቃᵓ⠏䚸ᡂᯝ≀⏕ᡂ䜢ᨭ᥼ 
䛩䜛䝒䞊䝹䚹 
• 䝣䜯䜲䝹䛾⨨䛟ሙᡤ➼䛾䛂Ỵ䜎䜚䛤䛸䛃䛾୰䛷䚸 
ຠ⋡䜘䛟㛤Ⓨ䜢㐍䜑䜛䛣䛸䛜䛷䛝䜛䚹
Alfresco䛾Maven䛷䛾㛤Ⓨ 
• 䜂䛺ᙧ䛛䜙䝥䝻䝆䜵䜽䝖䠄䜰䞊䝔䜱䝣䜯䜽䝖䠅䜢సᡂ 
• Tomcat䜔DB䛾‽ഛ䛜䛔䜙䛺䛔 
+ ᚲせ䛺䜒䛾䛿඲䛶⮬ືⓗ䛻䝎䜴䞁䝻䞊䝗 
• 㛤Ⓨ⎔ቃ䛾౫Ꮡ䛺䛧(Eclipse, Netbeans, ...
‽ഛ 
• Maven 3.0.3䜎䛯䛿䛭䜜௨ୖ 
• Java 1.7
⎔ቃኚᩘ䛾タᐃ 
• JAVA_HOME 
• MAVEN_OPTS 
export MAVEN_OPTS=“-Xms1024m –Xmx4096m 
–XX:PermSize=1024m”
䜽䜲䝑䜽䝇䝍䞊䝖! 
AMP䝥䝻䝆䜵䜽䝖䜢స䜛 
http://docs.alfresco.com/4.2/tasks/dev-extensions-maven-sdk-quick-start.html 
mvn archetype:gener...
AMP䛾䝃䞁䝥䝹䝥䝻䝆䜵䜽䝖䛾archetype 
䜢㑅ᢥ 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[I...
᭱᪂䛾archetype version䜢㑅ᢥ 
䠄䝕䝣䜷䝹䝖䠅 
Choose org.alfresco.maven.archetype:alfresco-amp-archetype 
version: 
1: 1.0 
2: 1.0.1 
...
௒䛛䜙సᡂ䛩䜛䝥䝻䝆䜵䜽䝖䛾groupId䛸 
artifactId䜢タᐃ 
Define value for property 'groupId': : jp.alfresco 
Define value for property 'arti...
䝍䞊䝀䝑䝖䛸䛺䜛war䜔Alfresco䛾䝞䞊 
䝆䝵䞁䛜䝕䝣䜷䝹䝖䛷タᐃ䛥䜜䜛! 
[INFO] Using property: version = 1.0-SNAPSHOT 
[INFO] Using property: package =...
タᐃ䛧䛯artifactId䛾ྡ๓䛷䝕䜱䝺䜽䝖䝸䛜 
䛷䛝䜛! 
YoshiMac:mvn aochi$ ls 
sample-amp
AMP䝃䞁䝥䝹䜢䛭䛾䜎䜎ື䛛䛩 
䝃䞁䝥䝹䝁䞊䝗䛜ධ䛳䛶䛔䜛䛾䛷䚸䛭䜜䜢ື䛛䛫䜛 
mvn 
integra2on-­‐test 
-­‐Pamp-­‐to-­‐war 
䝤䝷䜴䝄䛷䜰䜽䝉䝇 
h;p://localhost:8080/alfr...
Eclipse䜢౑䛳䛯⎔ቃᵓ⠏ 
‽ഛ 
• Eclipse 
Kelper 
J2EE䛰䛸maven䜒ධ䛳䛶䛔䜛 
• m2e 
Maven 
dependency 
plugin
M2e Maven Dependency Plugin䛾 
䜲䞁䝇䝖䞊䝹
M2e Maven Dependency Plugin䛾 
䜲䞁䝇䝖䞊䝹 
“Add” 
䛷 
h;p://ianbrandt.github.io/m2e-­‐maven-­‐dependency-­‐plugin/snapshots/ 
䛾䝃...
Maven䝥䝻䝆䜵䜽䝖䛾䜲䞁䝫䞊䝖
Maven䝥䝻䝆䜵䜽䝖䛾㑅ᢥ
䜲䞁䝫䞊䝖ᚋ䛾䝽䞊䜽䝇䝨䞊䝇
䝥䝻䝆䜵䜽䝖䛾㝵ᒙᵓ㐀 
䝣䜯䜲䝹䠋䝕䜱䝺䜽䝖䝸 ㄝ䚷䚷䚷䚷䚷᫂ 
src/main/java Java䝁䞊䝗䜢⨨䛟ሙᡤ䚹 
Alfresco.war䛜䝍䞊䝀䝑䝖䛾ሙྜ䚸 
䛣䛣䛻⨨䛛䜜䛯䝁䞊䝗䛿jar໬䛥䜜 
䛶WEB-­‐INF/lib䛻㓄...
Alfresco䛾䝍䞊䝀䝑䝖䝞䞊䝆䝵䞁䜢ኚ᭦䛩䜛 
(pom.xml) 
ኚ᭦ᚋ䚸୍ᗘ䜽䝸䞊䞁䛩䜛 
mvn 
clean 
-­‐Ppurge
What’s new in Alfresco SDK 2.0 
• Alfresco Maven SDK䛾ḟ䛾䝞䞊䝆䝵䞁 
• ⌧ᅾCommunity∧䛾䜏䚹Enterprise∧ 
䛿௒᭶䝸䝸䞊䝇ணᐃ 
• Spring-loaded䜢౑䛳䛯...
‽ഛ 
• spring-loaded䛾䝎䜴䞁䝻䞊䝗 
https://github.com/spring-projects/spring-loaded 
• MAVEN_OPTS䛾タᐃ 
export MAVEN_OPTS=-javaagen...
䝥䝻䝆䜵䜽䝖䛾సᡂ 
$ mvn archetype:generate -DarchetypeCatalog=https:// 
artifacts.alfresco.com/nexus/content/groups/public-snapsh...
Demo
For more info. 
• GitHub 
https://github.com/Alfresco/alfresco-sdk 
• Developer Document 
https://artifacts.alfresco.com/n...
QA
⿵㊊
SLF4J䛾౫Ꮡᛶ䛾ゎỴ (pom.xml)! 
᝟ሗ: WSSERVLET14: JAX-WS servlet initializing 
8 09, 2014 6:36:32 ༗ᚋ㻌org.apache.catalina.core.Appl...
SLF4J䛾౫Ꮡᛶ䛾ゎỴ㻌(pom.xml)
Upcoming SlideShare
Loading in …5
×

Alfresco sdk 2.0

660 views

Published on

MavenベースのAlfresco SDKについて

Published in: Software
  • Be the first to comment

  • Be the first to like this

Alfresco sdk 2.0

  1. 1. Alfresco SDK 2014/10/02 Yoshihiko Aochi Solution Engineer, Alfresco Japan
  2. 2. Maven䛸䛿 • http://maven.apache.org/ • 䝥䝻䝆䜵䜽䝖䛾⎔ቃᵓ⠏䚸ᡂᯝ≀⏕ᡂ䜢ᨭ᥼ 䛩䜛䝒䞊䝹䚹 • 䝣䜯䜲䝹䛾⨨䛟ሙᡤ➼䛾䛂Ỵ䜎䜚䛤䛸䛃䛾୰䛷䚸 ຠ⋡䜘䛟㛤Ⓨ䜢㐍䜑䜛䛣䛸䛜䛷䛝䜛䚹
  3. 3. Alfresco䛾Maven䛷䛾㛤Ⓨ • 䜂䛺ᙧ䛛䜙䝥䝻䝆䜵䜽䝖䠄䜰䞊䝔䜱䝣䜯䜽䝖䠅䜢సᡂ • Tomcat䜔DB䛾‽ഛ䛜䛔䜙䛺䛔 + ᚲせ䛺䜒䛾䛿඲䛶⮬ືⓗ䛻䝎䜴䞁䝻䞊䝗 • 㛤Ⓨ⎔ቃ䛾౫Ꮡ䛺䛧(Eclipse, Netbeans, IDEA etc.) • Community∧䚸Enterprise∧䛹䛱䜙䛷䜒฼⏝ྍ⬟ 䚷㻌䠄䜶䞁䝍䞊䝥䝷䜲䝈∧䛿ㄆドᚲせ䚹ㄆド䜻䞊䛸䜰䜽䝉 䝇᪉ἲ䛻䛴䛔䛶䛿Support Portal䜢ཧ↷䠅
  4. 4. ‽ഛ • Maven 3.0.3䜎䛯䛿䛭䜜௨ୖ • Java 1.7
  5. 5. ⎔ቃኚᩘ䛾タᐃ • JAVA_HOME • MAVEN_OPTS export MAVEN_OPTS=“-Xms1024m –Xmx4096m –XX:PermSize=1024m”
  6. 6. 䜽䜲䝑䜽䝇䝍䞊䝖! AMP䝥䝻䝆䜵䜽䝖䜢స䜛 http://docs.alfresco.com/4.2/tasks/dev-extensions-maven-sdk-quick-start.html mvn archetype:generate -DarchetypeCatalog=https:// artifacts.alfresco.com/nexus/content/groups/public/archetype-catalog. xml -Dfilter=org.alfresco.maven.archetype: 䝥䝻䝆䜵䜽䝖䛾సᡂ䜢ᑐヰᙧᘧ䛷సᡂ
  7. 7. AMP䛾䝃䞁䝥䝹䝥䝻䝆䜵䜽䝖䛾archetype 䜢㑅ᢥ [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom [INFO] [INFO] maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom [INFO] [INFO] --- maven-archetype-plugin:2.2: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: 1: https://artifacts.alfresco.com/nexus/content/groups/public/archetype-catalog.xml - org.alfresco.maven.archetype:alfresco-amp-archetype (Sample project with full support for lifecycle and rapid development of AMPs (Alfresco Module Packages)) 2: https://artifacts.alfresco.com/nexus/content/groups/public/archetype-catalog.xml - org.alfresco.maven.archetype:alfresco-allinone-archetype (Sample multi-module project for All-in-One development on the Alfresco plaftorm. Includes modules for: Repository, AMP, Share, Solr, Web Quick Start and embedded Jetty run) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Choose org.alfresco.maven.archetype:alfresco-amp-archetype version:
  8. 8. ᭱᪂䛾archetype version䜢㑅ᢥ 䠄䝕䝣䜷䝹䝖䠅 Choose org.alfresco.maven.archetype:alfresco-amp-archetype version: 1: 1.0 2: 1.0.1 3: 1.0.2 4: 1.1.0 5: 1.1.1 Choose a number: 5: 䛣䛣䛿Enter䜢ᢲ䛧䛶䛭䛾䜎䜎䝕䝣䜷䝹䝖䛷䜒䜘䛔 䠄ᚋ䛷ኚ᭦䛷䛝䜛䠅
  9. 9. ௒䛛䜙సᡂ䛩䜛䝥䝻䝆䜵䜽䝖䛾groupId䛸 artifactId䜢タᐃ Define value for property 'groupId': : jp.alfresco Define value for property 'artifactId': : sample-amp 䜰䞊䝔䜱䝣䜯䜽䝖䠖maven䛷స䜙䜜䜛䝥䝻䝆䜵䜽䝖䛸䛭䛾ᡂᯝ≀ groupId: 䛣䛾䜰䞊䝔䜱䝣䜯䜽䝖䜢సᡂ䛧䛯⤌⧊䛾ID䠄౛䛘䜀䚸఍♫䝗䝯䜲䞁䠅 ar2factId: 䛣䛾䜰䞊䝔䜱䝣䜯䜽䝖䛾Id
  10. 10. 䝍䞊䝀䝑䝖䛸䛺䜛war䜔Alfresco䛾䝞䞊 䝆䝵䞁䛜䝕䝣䜷䝹䝖䛷タᐃ䛥䜜䜛! [INFO] Using property: version = 1.0-SNAPSHOT [INFO] Using property: package = (not used) [INFO] Using property: alfresco_target_amp_client_war = alfresco [INFO] Using property: alfresco_target_amp_client_war_groupId = org.alfresco [INFO] Using property: alfresco_target_amp_client_war_version = 4.2.e [INFO] Using property: alfresco_target_groupId = org.alfresco [INFO] Using property: alfresco_target_version = 4.2.e Confirm properties configuration: groupId: jp.alfresco artifactId: sample-amp version: 1.0-SNAPSHOT package: (not used) alfresco_target_amp_client_war: alfresco alfresco_target_amp_client_war_groupId: org.alfresco alfresco_target_amp_client_war_version: 4.2.e alfresco_target_groupId: org.alfresco alfresco_target_version: 4.2.e Y: : 䛣䛣䛿Enter䜢ᢲ䛧䛶䛭䛾䜎䜎䝕䝣䜷䝹䝖䛷䜒䜘䛔 䠄ᚋ䛷ኚ᭦䛷䛝䜛䠅
  11. 11. タᐃ䛧䛯artifactId䛾ྡ๓䛷䝕䜱䝺䜽䝖䝸䛜 䛷䛝䜛! YoshiMac:mvn aochi$ ls sample-amp
  12. 12. AMP䝃䞁䝥䝹䜢䛭䛾䜎䜎ື䛛䛩 䝃䞁䝥䝹䝁䞊䝗䛜ධ䛳䛶䛔䜛䛾䛷䚸䛭䜜䜢ື䛛䛫䜛 mvn integra2on-­‐test -­‐Pamp-­‐to-­‐war 䝤䝷䜴䝄䛷䜰䜽䝉䝇 h;p://localhost:8080/alfresco
  13. 13. Eclipse䜢౑䛳䛯⎔ቃᵓ⠏ ‽ഛ • Eclipse Kelper J2EE䛰䛸maven䜒ධ䛳䛶䛔䜛 • m2e Maven dependency plugin
  14. 14. M2e Maven Dependency Plugin䛾 䜲䞁䝇䝖䞊䝹
  15. 15. M2e Maven Dependency Plugin䛾 䜲䞁䝇䝖䞊䝹 “Add” 䛷 h;p://ianbrandt.github.io/m2e-­‐maven-­‐dependency-­‐plugin/snapshots/ 䛾䝃䜲䝖䜢㏣ຍ 䝏䜵䝑䜽䜢ධ䜜䛶”Next”
  16. 16. Maven䝥䝻䝆䜵䜽䝖䛾䜲䞁䝫䞊䝖
  17. 17. Maven䝥䝻䝆䜵䜽䝖䛾㑅ᢥ
  18. 18. 䜲䞁䝫䞊䝖ᚋ䛾䝽䞊䜽䝇䝨䞊䝇
  19. 19. 䝥䝻䝆䜵䜽䝖䛾㝵ᒙᵓ㐀 䝣䜯䜲䝹䠋䝕䜱䝺䜽䝖䝸 ㄝ䚷䚷䚷䚷䚷᫂ src/main/java Java䝁䞊䝗䜢⨨䛟ሙᡤ䚹 Alfresco.war䛜䝍䞊䝀䝑䝖䛾ሙྜ䚸 䛣䛣䛻⨨䛛䜜䛯䝁䞊䝗䛿jar໬䛥䜜 䛶WEB-­‐INF/lib䛻㓄⨨䛥䜜䜛 src/main/amp ampෆ䛾䝣䜯䜲䝹䛿䛣䛣䛻⨨䛟䠄ᚋ ㏙䠅 src/test/java 䝔䝇䝖⏝䛾䝁䞊䝗䜢⨨䛟ሙᡤ src/test/resources 䝔䝇䝖⏝䛾䝸䝋䞊䝇䝣䜯䜲䝹䜢⨨䛟 ሙᡤ pom.xml 䛣䛾䝥䝻䝆䜵䜽䝖䛾᝟ሗ䛜グ㍕䛥 䜜䜛䝣䜯䜲䝹䚹䠄౫Ꮡᛶ䚸䝍䞊䝀䝑䝖 ➼䠅
  20. 20. Alfresco䛾䝍䞊䝀䝑䝖䝞䞊䝆䝵䞁䜢ኚ᭦䛩䜛 (pom.xml) ኚ᭦ᚋ䚸୍ᗘ䜽䝸䞊䞁䛩䜛 mvn clean -­‐Ppurge
  21. 21. What’s new in Alfresco SDK 2.0 • Alfresco Maven SDK䛾ḟ䛾䝞䞊䝆䝵䞁 • ⌧ᅾCommunity∧䛾䜏䚹Enterprise∧ 䛿௒᭶䝸䝸䞊䝇ணᐃ • Spring-loaded䜢౑䛳䛯䝩䝑䝖䝁䞊䝗䝸 䝻䞊䝗䛜ྍ⬟
  22. 22. ‽ഛ • spring-loaded䛾䝎䜴䞁䝻䞊䝗 https://github.com/spring-projects/spring-loaded • MAVEN_OPTS䛾タᐃ export MAVEN_OPTS=-javaagent:/spring-loaded䜢⨨䛔䛯 䝣䜯䜲䝹䝟䝇/springloaded-1.2.0.RELEASE.jar -noverify - Xmx1024m -Xmx4096m -XX:PermSize=1024m
  23. 23. 䝥䝻䝆䜵䜽䝖䛾సᡂ $ mvn archetype:generate -DarchetypeCatalog=https:// artifacts.alfresco.com/nexus/content/groups/public-snapshots/archetype-catalog. xml -Dfilter=org.alfresco.maven.archetype: pom.xml䛾ኚ᭦ parent groupIdorg.alfresco.maven/groupId ar2factIdalfresco-­‐sdk-­‐parent/ar2factId version2.0.0-­‐beta-­‐1/version /parent 2014/10/02⌧ᅾ 2.0.0-­‐beta-­‐3䛜᭱᪂∧ ᭱᪂䝞䞊䝆䝵䞁䛿௨ୗ䜢☜ㄆ䛟䛰䛥䛔䠖 h;ps://ar2facts.alfresco.com/nexus/content/groups/public/alfresco-­‐sdk-­‐aggregator/latest/index.html
  24. 24. Demo
  25. 25. For more info. • GitHub https://github.com/Alfresco/alfresco-sdk • Developer Document https://artifacts.alfresco.com/nexus/content/groups/ public/alfresco-sdk-aggregator/latest/index.html • Alfresco Documentation http://docs.alfresco.com/4.2/concepts/dev-extensions- maven-sdk-intro.html
  26. 26. QA
  27. 27. ⿵㊊
  28. 28. SLF4J䛾౫Ꮡᛶ䛾ゎỴ (pom.xml)! ᝟ሗ: WSSERVLET14: JAX-WS servlet initializing 8 09, 2014 6:36:32 ༗ᚋ㻌org.apache.catalina.core.ApplicationContext log ᝟ሗ: Marking servlet axis as unavailable 8 09, 2014 6:36:32 ༗ᚋ㻌org.apache.catalina.core.StandardContext loadOnStartup 㔜኱: Servlet /alfresco threw load() exception org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.SLF4JLogFactory does not implement org.apache.commons.logging.LogFactory at org.apache.commons.discovery.tools.ClassUtils.verifyAncestory(ClassUtils.java:180) at org.apache.commons.discovery.tools.SPInterface.verifyAncestory(SPInterface.java:201) at org.apache.commons.discovery.tools.SPInterface.newInstance(SPInterface.java:195) at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579) at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418) at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378) at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45) at java.security.AccessController.doPrivileged(Native Method) at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41) at org.apache.axis.components.logger.LogFactory.clinit(LogFactory.java:33) 䠄㏵୰␎䠅 8 09, 2014 6:36:33 ༗ᚋ㻌org.apache.coyote.AbstractProtocol start ᝟ሗ: Starting ProtocolHandler [http-bio-8080]
  29. 29. SLF4J䛾౫Ꮡᛶ䛾ゎỴ㻌(pom.xml)

×