Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade documentation for 2.1.0 to 2.1.1 is wrong #342

Closed
jrosler opened this issue Oct 30, 2015 · 4 comments
Closed

Upgrade documentation for 2.1.0 to 2.1.1 is wrong #342

jrosler opened this issue Oct 30, 2015 · 4 comments
Assignees
Milestone

Comments

@jrosler
Copy link

jrosler commented Oct 30, 2015

The doc at http://docs.alfresco.com/5.0/tasks/alfresco-sdk-upgrading-sdkversion-210-211.html states that you can upgrade current sdk 2.1.0 to 2.1.1 by changing the version to the parent sdk in your base project pom. This is not correct. There is a problem with runner/pom.xml.

The 2.1.0 runner/pom.xml alfresco.data.dir was set to
<alfresco.solr.dir>${project.parent.basedir}/${alfresco.data.location}/solr4</alfresco.solr.dir>
and the 2.1.1 runner/pom.xml
<alfresco.solr.dir>${alfresco.data.location}/solr4</alfresco.solr.dir>

the alfresco.data.location in alfresco-sdk-parent-2.1.0.pom
<alfresco.data.location>alf_data_dev</alfresco.data.location>
and the 2.1.1 in alfresco-sdk-parent-2.1.1.pom
<alfresco.data.location>${session.executionRootDirectory}/alf_data_dev</alfresco.data.location>

This causes the alfresco.solr.dir to get set incorrectly to your base directory path twice as it is combined incorrectly.

<alfresco.data.location>${session.executionRootDirectory}/alf_data_dev</alfresco.data.location>
<alfresco.solr.dir>${project.parent.basedir}/${alfresco.data.location}/solr4</alfresco.solr.dir>

You can see the problem if you install an AIO with SDK 2.1.0 and then before running a build updating your project pom.xml to version 2.1.1 and running ./run.sh. solr won't start up because it's config files didn't get copied to the right directory. If you already had already run once with the SDK 2.1.0 before, you can see this by running a purge and then changing the version to 2.1.1.

@ahmedowian
Copy link

I think @jrosler meant alfresco.solr.dir when he said:

The 2.1.0 runner/pom.xml alfresco.data.dir was set to

I also see that upgrading created another /absolute/path/to/alf_data_dev in the ${project.parent.basedir}
For example, I now have a /Users/ahmedowian/Development/projects/saml/code/Users/ahmedowian/Development/projects/saml/code/alf_data_dev/solr4

I see when comparing a freshly generated 2.1.0 AIO project to a freshly generated 2.1.1 AIO project a few differences regarding solr properties. I applied the following patch, upgraded, and everything worked fine.

Index: pom.xml
===================================================================
--- pom.xml (revision 120094)
+++ pom.xml (working copy)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.alfresco.maven</groupId>
         <artifactId>alfresco-sdk-parent</artifactId>
-        <version>2.1.0</version>
+        <version>2.1.1</version>
     </parent>

     <!-- 
Index: run.sh
===================================================================
--- run.sh  (revision 120094)
+++ run.sh  (working copy)
@@ -6,4 +6,4 @@
 if [ ! -f $springloadedfile ]; then
 mvn validate -Psetup
 fi
-MAVEN_OPTS="-javaagent:$springloadedfile -noverify -Xms256m -Xmx2G" mvn clean install -Prun,enterprise
+MAVEN_OPTS="-javaagent:$springloadedfile -noverify -Xms256m -Xmx2G -XX:MaxPermSize=512m" mvn clean install -Prun,enterprise -DskipTests
Index: runner/pom.xml
===================================================================
--- runner/pom.xml  (revision 120094)
+++ runner/pom.xml  (working copy)
@@ -19,8 +19,9 @@
             <!-- TODO: figure out a way to define these properties in a parent POM, they are now also duplicated
                        in the solr-config/pom.xml -->
             <properties>
-                <alfresco.solr.dir>${project.parent.basedir}/${alfresco.data.location}/solr4</alfresco.solr.dir>
+                <alfresco.solr.dir>${alfresco.data.location}/solr4</alfresco.solr.dir>
                 <alfresco.solr.home.dir>${alfresco.solr.dir}/config</alfresco.solr.home.dir>
+                <alfresco.solr.data.dir>${alfresco.solr.dir}/data</alfresco.solr.data.dir>
             </properties>

             <build>
Index: runner/tomcat/context-solr.xml
===================================================================
--- runner/tomcat/context-solr.xml  (revision 120094)
+++ runner/tomcat/context-solr.xml  (working copy)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Context>
-    <Environment name="solr/home"        type="java.lang.String" value="${project.parent.basedir}/alf_data_dev/solr4/config/" override="true"/>
-    <Environment name="solr/model/dir"   type="java.lang.String" value="${project.parent.basedir}/alf_data_dev/solr4/config/alfrescoModels/" override="true"/>
-    <Environment name="solr/content/dir" type="java.lang.String" value="${project.parent.basedir}/alf_data_dev/solr4/data/content/" override="true"/>
+    <Environment name="solr/home"        type="java.lang.String" value="${alfresco.solr.home.dir}/" override="true"/>
+    <Environment name="solr/model/dir"   type="java.lang.String" value="${alfresco.solr.home.dir}/alfrescoModels/" override="true"/>
+    <Environment name="solr/content/dir" type="java.lang.String" value="${alfresco.solr.data.dir}/content/" override="true"/>

     <!-- Pick up static resource files from any Solr extensions, being it a JAR or an AMP,
          by default there are no extensions, just the standard Solr webapp files.
Index: share-amp/pom.xml
===================================================================
--- share-amp/pom.xml   (revision 120094)
+++ share-amp/pom.xml   (working copy)
@@ -85,6 +85,7 @@
             <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>selenium-java</artifactId>
             <version>2.45.0-alfresco</version>
+            <scope>test</scope>
         </dependency>
         <!-- Test NG is defined with test scope in share-po, so need it here too -->
         <!-- Alfresco code creates a wrapper around Test NG -->
Index: solr-config/pom.xml
===================================================================
--- solr-config/pom.xml (revision 120094)
+++ solr-config/pom.xml (working copy)
@@ -21,7 +21,7 @@
             <id>run</id>

             <properties>
-                <alfresco.solr.dir>${project.parent.basedir}/${alfresco.data.location}/solr4</alfresco.solr.dir>
+                <alfresco.solr.dir>${alfresco.data.location}/solr4</alfresco.solr.dir>
                 <alfresco.solr.home.dir>${alfresco.solr.dir}/config</alfresco.solr.home.dir>
                 <alfresco.solr.data.dir>${alfresco.solr.dir}/data</alfresco.solr.data.dir>
             </properties>

@ahmedowian
Copy link

What did you do to get around this, @jrosler ?

@gravitonian
Copy link
Contributor

See https://issues.alfresco.com/jira/browse/DEVPLAT-380, list what you need to do

@ohej ohej added this to the 2.2.0 milestone Jan 11, 2016
@gravitonian gravitonian self-assigned this Jan 12, 2016
@gravitonian
Copy link
Contributor

Fixed in 5.0 and 5.1 doc branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants