You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2018/08/31 23:46:42 UTC

[isis] branch maint-1.16.2 updated (6dc5282 -> 351e496)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git.


    from 6dc5282  ISIS-1974: initializes the Isis metamodel and DN in parallel.
     new b3eb20c  ISIS-1974: introspects in parallel
     new f6d218d  ISIS-1974: workaround for gitlab CI issue
     new 188ae32  ISIS-1974: adds logging and larger queue for ThreadPoolSupport
     new d096480  ISIS-1977: moves flattening plugin into a profile
     new 36e738f  ISIS-1965: reworks the flatten maven plugin
     new 351e496  ISIS-1965: reworks the flatten maven plugin - fixes typo

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitlab-ci.yml                                     |   1 +
 core/applib/pom.xml                                |  45 +++
 core/integtestsupport/pom.xml                      |  46 +++
 core/log4j/pom.xml                                 |  46 +++
 core/maven-plugin/pom.xml                          |  45 +++
 core/mavendeps/intellij/pom.xml                    |  42 ++-
 core/mavendeps/testing/pom.xml                     |  43 ++-
 core/mavendeps/webapp/pom.xml                      |  43 ++-
 core/metamodel/pom.xml                             |  46 +++
 .../metamodel/specloader/SpecificationLoader.java  |  88 ++++-
 .../specimpl/dflt/ObjectSpecificationDefault.java  |   1 -
 .../core/runtime/threadpool/ThreadPoolSupport.java |  88 ++++-
 .../dflt/ProgrammingModelForObjectSpecIdFacet.java |  45 +++
 core/pom.xml                                       |  70 ++--
 core/runtime/pom.xml                               |  44 ++-
 .../system/session/IsisSessionFactoryBuilder.java  |  41 ++-
 core/schema/pom.xml                                |  43 +++
 core/security-shiro/pom.xml                        |  46 +++
 core/security/pom.xml                              |  47 +++
 core/specsupport/pom.xml                           |  45 +++
 core/unittestsupport/pom.xml                       |  46 +++
 core/viewer-restfulobjects-applib/pom.xml          |  45 +++
 core/viewer-restfulobjects-rendering/pom.xml       |  47 +++
 core/viewer-restfulobjects-server/pom.xml          |  47 +++
 core/viewer-wicket-applib/pom.xml                  |  47 +++
 core/viewer-wicket-impl/pom.xml                    |  47 +++
 .../wicket/viewer/IsisWicketApplication.java       |  28 +-
 core/viewer-wicket-model/pom.xml                   |  47 +++
 core/viewer-wicket-ui/pom.xml                      |  47 +++
 core/webserver/pom.xml                             |  46 +++
 core/wrapper/pom.xml                               |  47 +++
 .../src/main/webapp/WEB-INF/logging.properties     |  13 +-
 .../src/main/webapp/WEB-INF/logging.properties     |  13 +-
 todo-deprecation-list.txt                          | 360 +++++++++++++++++++++
 34 files changed, 1713 insertions(+), 82 deletions(-)
 create mode 100644 core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelForObjectSpecIdFacet.java
 create mode 100644 todo-deprecation-list.txt


[isis] 02/06: ISIS-1974: workaround for gitlab CI issue

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit f6d218d3b2411722392d2caae05f29c1cb2ead95
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Aug 29 14:39:38 2018 +0200

    ISIS-1974: workaround for gitlab CI issue
---
 .gitlab-ci.yml            |  57 +++++---
 todo-deprecation-list.txt | 360 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 395 insertions(+), 22 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e69e8d5..50607a9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -44,27 +44,40 @@ build-package-push:
           -Dnexus-deploy.repositoryUrl=$NEXUS_REPO_URL \
           $CORE_ADDITIONAL_OPTS
     - cd ..
-    - cd example/application/$APP_NAME
-    - >
-      mvn --batch-mode \
-          install \
-          -Drevision=$REVISION \
-          -Disis.version=$REVISION \
-          -Dmavenmixin-docker \
-          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME
-    - >
-      mvn -s .m2/settings.xml \
-          --batch-mode \
-          docker:push@push-image-tagged \
-          -pl webapp \
-          -Drevision=$REVISION \
-          -Disis.version=$REVISION \
-          -DskipTests \
-          -Dskip.isis-swagger \
-          -Dmavenmixin-docker \
-          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME \
-          -Ddocker-plugin.serverId=docker-registry \
-          -Ddocker.registryUrl=$DOCKER_REGISTRY_URL
-    - cd ../../..
 
+#
+# remainder commented out for now, see: https://gitlab.com/gitlab-org/gitlab-runner/issues/3552
+#
+# it's possible that the mvn command to build the Docker image is failing ... it seems to get stuck.
+# maybe the background stuff is deadlocking?
+# then, the CI job for reporting the failure/uploading artifacts then hangs.
+# if that's correct, then commenting this out is a problem because we're masking an error on our side.
+#
+# on the other hand, I can't reproduce this issue locally.
+#
 
+#    - cd example/application/$APP_NAME
+#    - >
+#      mvn --batch-mode \
+#          install \
+#          -Drevision=$REVISION \
+#          -Disis.version=$REVISION \
+#          $CORE_ADDITIONAL_OPTS \
+#          -Dmavenmixin-docker \
+#          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME
+#    - >
+#      mvn -s .m2/settings.xml \
+#          --batch-mode \
+#          docker:push@push-image-tagged \
+#          -pl webapp \
+#          -Drevision=$REVISION \
+#          -Disis.version=$REVISION \
+#          -DskipTests \
+#          -Dskip.isis-swagger \
+#          -Dmavenmixin-docker \
+#          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME \
+#          -Ddocker-plugin.serverId=docker-registry \
+#          -Ddocker.registryUrl=$DOCKER_REGISTRY_URL
+#    - cd ../../..
+#
+#
diff --git a/todo-deprecation-list.txt b/todo-deprecation-list.txt
new file mode 100644
index 0000000..7c1e176
--- /dev/null
+++ b/todo-deprecation-list.txt
@@ -0,0 +1,360 @@
+
+for 2.0.0-M2
+
+
+remove:
+- @MemberGroupLayout
+- contributed domain services (use mixins instead)
+- org.apache.isis.applib.clock
+  - Clock singleton
+- SwitchUserService
+- AbstractFixtureSusa
+- org.apache.isis.core.runtime.services.eventbus.adapter.EventBusImplementationForGuava
+
+- org.apache.isis.applib.services.memento  (19 usages found)
+  - MementoService.java - remove entire service (previously to support view models, but now @ViewModel and JAXB)
+
+to change:
+- automatically wrap domain services (perhaps behind a config property)
+- automatically infer \@Programmatic for all \@DomainService(nature=DOMAIN)
+
+
+support for legacy implementation of UrlEncodingService
+- as an automatic fallback; has changed to use with compression by default.
+
+inline paraname8 from incode platform
+
+remove isis-core-wicket-applib 
+- contains only WicketDeveloperUtilitiesService, which is hidden anyway and seems to not be required.
+
+update .xsd for layout, make render optional and deprecated.    
+   
+- deprecate FixtureScripts service with view to removing from applib ... the framework provides an implementation by default
+- get rid of automatic initialization of fields (perhaps behind a config property)
+- deprecate the Apache Isis' DateTime classes for removal in the future) ... and probably all of the custom value types, subclasses of Magnitude
+- merge metamodel and runtime
+- remove *Installer
+
+move ContentMappingServiceForCommandDto and ContentMappingServiceForCommandsDto from applib.conmap to applib.services.conmap.commands
+
+IsisContext:
+- remove this, causes a stack trace...
+
+    // -- HELPER
+
+    /**
+     * TODO [andi-huber] not sure if required, initial idea was to force log4j
+     * re-configuration on an undeploy/deploy cycle
+     */
+    static void resetLogging() {
+        try {
+            org.apache.log4j.BasicConfigurator.resetConfiguration();
+            org.apache.log4j.Logger.getRootLogger().removeAllAppenders();
+        } catch (Exception e) {
+            // at least we tried
+        }
+    }
+
+TitleFacetViaAnnotation may not work if on a field, due to DN lazy loading.
+
+
+remove AbstractService from applib.
+remove AbstractViewModel from applib.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+the stuff below here was working notes for 2.0.0-M1, not necessarily up to date.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+1.16.2
+- flag to make @Action mandatory, @Programmatic the default
+
+
+OTHER STUFF:
+
+PublishingServiceInternalDefault
+
+not thread-safe:
+
+    boolean suppress;
+
+    @Programmatic
+    @Override
+    public <T> T withPublishingSuppressed(final Block<T> block) {
+        try {
+            suppress = true;
+            return block.exec();
+        } finally {
+            suppress = false;
+        }
+    }
+    
+~~~~~~~~
+
+
+
+
+
+
+
+link:https://issues.apache.org/jira/browse/ISIS-743[ISIS-743] - @NotPersistable annotation
+
+
+
+
+*************************************************************************
+
+PROPOSE TO RETAIN:
+
+
+Below is the code currently deprecated in the applib, but I propose to retain even in 2.0.0 (on the grounds that a replacement for them is not fully designed):
+org.apache.isis.applib.adapters  - custom value type support
+
+
+org.apache.isis.applib.annotation
+
+    Encodable.java - entire annotation, part of custom value types support
+    Parseable.java - entire annotation, part of custom value types support
+
+
+org.apache.isis.applib.fixtures  - "legacy" fixture support package ... by and large can use FixtureScripts (though not sure if there's feature parity in all cases)
+    AbstractFixture.java
+    AbstractFixtureSusa.java
+    BaseFixture.java
+    CompositeFixture.java
+    DateFixture.java
+    LogonFixture.java
+org.apache.isis.applib.fixtures.switchuser
+    SwitchUserService.java
+    SwitchUserServiceAware.java
+
+
+
+
+org.apache.isis.applib.services.command
+    Command.java  - methods that pertain to the execution of the command and its completion (for that, use Interaction) [suggest we retain for now]
+        getCompletedAt()
+        getException()
+        getResult()
+        getStartedAt()
+        next(String)
+        setCompletedAt(Timestamp)
+        setStartedAt(Timestamp)
+        flushActionDomainEvents()
+        peekActionDomainEvent()
+        popActionDomainEvent()
+        pushActionDomainEvent(ActionDomainEvent<?>)  (
+
+    MemberGroupsLayout.java - retain
+
+
+
+
+*************************************************************************
+
+DEPRECATED:
+
+    deprecate support for contributed services (use mixins instead)
+
+
+DONE (ADDED)
+
+    new support for JSR-303 @Pattern annotation (http://beanvalidation.org/1.0/spec/, chapter 6) ... replaces @RegEx
+
+
+DONE (MOVED)
+
+    org.apache.isis.applib.events        - moved to services.wrapper.events.  (Still useful as provide context for exceptions, for a "transcript" framework).
+    org.apache.isis.applib.events.system - move to fixturescripts.events.
+    org.apache.isis.applib.conmap.ContentMappingService to applib.services.conmap
+
+
+DONE (REMOVED):
+
+    make AppManifest mandatory
+
+    removed support for Xxx.layout.json
+    - "reflector.layoutMetadataReaders" config prop
+
+    removed support for static method prefixes
+    * "notInServiceMenu"
+    * "named"
+    * "plural"
+    * "alwaysHide"
+    * "protect"
+    * "description"
+    * "optional"
+
+    remove explorationXxx() prefix
+
+
+
+
+
+org.apache.isis.applib.clock
+    Clock.java -
+        getTimeAsCalendar()
+        getTimeAsDate()
+
+
+		
+org.apache.isis.applib.services.actinvoc
+    ActionInvocationContext.java -remove unused constructors
+
+
+org.apache.isis.applib.services.audit  (2 usages found)
+    AuditingService3.java - remove entire service, use AuditerService instead
+
+
+org.apache.isis.applib.services.background  (10 usages found)
+    ActionInvocationMemento.java - remove entire class, use InteractionDto and CommandDto are used internally instead
+    BackgroundCommandService.java - remove methods using AIM, instead keep those using CommandDto (in BackgroundCommandService2)
+    BackgroundService.java
+        asActionInvocationMemento(Method, Object, Object[]) - remove this internal API, no longer called by framework
+
+    Remove support for legacy persisted commands (beginning "<memento>...")
+
+
+
+org.apache.isis.applib.services.bookmark  (8 usages found)
+    BookmarkService2.java - pull up its methods into BookmarkService supertype, and delete
+
+
+org.apache.isis.applib.services.classdiscovery
+    ClassDiscoveryService2.java , pull up its methods into ClassDiscoveryService supertype, and delete
+
+
+
+org.apache.isis.applib.services.command.spi
+    CommandService.java
+        startTransaction(Command, UUID) - no longer required to do anything, so remove
+
+
+
+
+org.apache.isis.applib.services.command
+    Command2.java  - methods for working with interaction events (remove with those event types)
+        flushActionInteractionEvents()
+        peekActionInteractionEvent()
+        popActionInteractionEvent()
+        pushActionInteractionEvent(ActionInteractionEvent<?>)
+
+org.apache.isis.applib.services.command
+    Command3 rolled up into Command
+
+
+org.apache.isis.applib.services.eventbus
+    AbstractInteractionEvent.java - remove
+    ActionInteractionEvent.java - remove
+    ActionInvokedEvent.java - remove
+    CollectionAddedToEvent.java - remove
+    CollectionInteractionEvent.java - remove
+    CollectionRemovedFromEvent.java  - remove
+    PropertyChangedEvent.java - remove
+    PropertyInteractionEvent.java - remove
+
+
+org.apache.isis.applib.services.exceprecog
+
+    rolls ExceptionRecognizer2 up into ExceptionRecognizer
+
+
+org.apache.isis.applib.services.metamodel
+    MetaModelService2.java and MetaModelService3 - pulled up to MetaModelService supertype
+
+
+
+
+org.apache.isis.applib.services.publish - remove classes pertaining to original PublishingService (payload factories etc).
+    EventMetadata.java - remove class
+    EventType.java - remove class
+    EventPayload.java - remove class
+    EventPayloadForActionInvocation.java - remove class
+    EventPayloadForObjectChanged.java - remove class
+
+    PublishedEventStateType.java - remove class
+    PublishingService.java - remove domain service interface
+    StatusMessageMessageType.java - remove class
+
+org.apache.isis.applib.services.registry
+    ServiceRegistry2 - roll up to ServiceRegistry
+
+
+
+
+org.apache.isis.applib.services.settings
+    SettingTypes.java - remove, used only by 3rd party code (incode platform settings module)
+
+org.apache.isis.applib.services.wrapper
+    WrapperObject.java
+        save() and wrapped() - remove to avoid name clashes, use __isis_Xxx() methods instead
+
+
+org.apache.isis.applib.snapshot
+    Snapshottable.java - remove, since unused
+
+
+org.apache.isis.applib.value
+    DateTime.java
+        longValue() - use #millisSinceEpoch()
+    Time.java
+        longValue() - use #millisSinceEpoch()
+
+
+org.apache.isis.applib
+
+    DomainObjectContainer.java
+    - titleOf       ... use TitleService#titleOf(...) instead
+    - iconNameOf    ... use TitleService#iconNameOf(...) instead
+    - flush()       ... use TransactionService#flushTransaction instead
+    - informUser, warnUser, raiseError ... use MessageService
+    - getUser                          ... use UserService
+    - getProperty, getPropertyNames    ... use ConfigurationService
+    - injectServicesInto, lookupService, lookupServices   ... use ServicesRegistry
+    - newTransientInstance - use FactoryService#instantiate
+    - newAggregatedInstance - no replacement
+    - newPersistentInstance - no replacement
+    - newInstance - no replacement
+    - mixin - use FactoryService#mixin
+    - isPersistent, persistIfNotAlready, removeIfNotAlready - use RepositoryService instead
+
+
+org.apache.isis.objectstore.jdo.applib.service
+    DomainChangeJdoAbstract.java
+        - deleted, not replacement (used only by incode platform)
+        - https://github.com/apache/isis/blob/rel/isis-1.15.1/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/DomainChangeJdoAbstract.java
+    JdoColumnLength.java
+        - ditto
+        - https://github.com/apache/isis/blob/rel/isis-1.15.1/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/JdoColumnLength.java
+    Util.java
+        - ditto
+        - https://github.com/apache/isis/blob/rel/isis-1.15.1/core/applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/Util.java
+
+
+org.apache.isis.core.objectstore.jdo.applib.annotations - remove package entirely
+    Auditable.java - use @DomainObject(audited=...) instead.
+org.apache.isis.objectstore.jdo.applib
+    Auditable.java interface - use @DomainObject(audited=...) instead.
+
+
+org.apache.isis.objectstore.jdo.applib.service.support
+    IsisJdoSupport.java - replaced by org.apache.isis.applib.services.jdosupport.IsisJdoSupport
+
+
+
+org.apache.isis.viewer.restfulobjects.rendering.service.conmap.ContentMappingService
+    - replaced by non-applib
+
+org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceForRestfulObjects
+    - unused
+
+
+
+ObjectFixtureService + supporting classes
+
+


[isis] 06/06: ISIS-1965: reworks the flatten maven plugin - fixes typo

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 351e496bc95d3e509157892b9c7d4ce78df4f57a
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Sep 1 00:46:22 2018 +0100

    ISIS-1965: reworks the flatten maven plugin - fixes typo
---
 core/mavendeps/testing/pom.xml | 2 +-
 core/mavendeps/webapp/pom.xml  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/mavendeps/testing/pom.xml b/core/mavendeps/testing/pom.xml
index 7108dba..1ec054c 100644
--- a/core/mavendeps/testing/pom.xml
+++ b/core/mavendeps/testing/pom.xml
@@ -110,7 +110,7 @@
                                     <updatePomFile>true</updatePomFile>
                                     <pomElements>
                                         <parent>resolve</parent>
-                                        <profile>resolve</profile>
+                                        <profiles>resolve</profiles>
                                     </pomElements>
                                 </configuration>
                             </execution>
diff --git a/core/mavendeps/webapp/pom.xml b/core/mavendeps/webapp/pom.xml
index 715e52b..804d6d2 100644
--- a/core/mavendeps/webapp/pom.xml
+++ b/core/mavendeps/webapp/pom.xml
@@ -124,7 +124,7 @@
                                     <updatePomFile>true</updatePomFile>
                                     <pomElements>
                                         <parent>resolve</parent>
-                                        <profile>resolve</profile>
+                                        <profiles>resolve</profiles>
                                     </pomElements>
                                 </configuration>
                             </execution>


[isis] 04/06: ISIS-1977: moves flattening plugin into a profile

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit d096480e06000034629cc14b237455a5075b2bf7
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Sep 1 00:03:55 2018 +0100

    ISIS-1977: moves flattening plugin into a profile
    
    and uses a different configuration for pom vs regular jar modules
---
 core/applib/pom.xml                          | 45 ++++++++++++++++++
 core/integtestsupport/pom.xml                | 46 ++++++++++++++++++
 core/log4j/pom.xml                           | 46 ++++++++++++++++++
 core/maven-plugin/pom.xml                    | 45 ++++++++++++++++++
 core/mavendeps/intellij/pom.xml              | 42 ++++++++++++++++-
 core/mavendeps/testing/pom.xml               | 43 ++++++++++++++++-
 core/mavendeps/webapp/pom.xml                | 43 ++++++++++++++++-
 core/metamodel/pom.xml                       | 46 ++++++++++++++++++
 core/pom.xml                                 | 70 ++++++++++++++++------------
 core/runtime/pom.xml                         | 44 ++++++++++++++++-
 core/schema/pom.xml                          | 43 +++++++++++++++++
 core/security-shiro/pom.xml                  | 46 ++++++++++++++++++
 core/security/pom.xml                        | 47 +++++++++++++++++++
 core/specsupport/pom.xml                     | 45 ++++++++++++++++++
 core/unittestsupport/pom.xml                 | 46 ++++++++++++++++++
 core/viewer-restfulobjects-applib/pom.xml    | 45 ++++++++++++++++++
 core/viewer-restfulobjects-rendering/pom.xml | 47 +++++++++++++++++++
 core/viewer-restfulobjects-server/pom.xml    | 47 +++++++++++++++++++
 core/viewer-wicket-applib/pom.xml            | 47 +++++++++++++++++++
 core/viewer-wicket-impl/pom.xml              | 47 +++++++++++++++++++
 core/viewer-wicket-model/pom.xml             | 47 +++++++++++++++++++
 core/viewer-wicket-ui/pom.xml                | 47 +++++++++++++++++++
 core/webserver/pom.xml                       | 46 ++++++++++++++++++
 core/wrapper/pom.xml                         | 47 +++++++++++++++++++
 24 files changed, 1083 insertions(+), 34 deletions(-)

diff --git a/core/applib/pom.xml b/core/applib/pom.xml
index 291196b..3054ac2 100644
--- a/core/applib/pom.xml
+++ b/core/applib/pom.xml
@@ -161,4 +161,49 @@
 
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
diff --git a/core/integtestsupport/pom.xml b/core/integtestsupport/pom.xml
index 8da1fd2..0f40299 100644
--- a/core/integtestsupport/pom.xml
+++ b/core/integtestsupport/pom.xml
@@ -80,4 +80,50 @@
         </dependency>
 
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
diff --git a/core/log4j/pom.xml b/core/log4j/pom.xml
index e405bfc..d2d9459 100644
--- a/core/log4j/pom.xml
+++ b/core/log4j/pom.xml
@@ -53,4 +53,50 @@
         
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/maven-plugin/pom.xml b/core/maven-plugin/pom.xml
index 5620e29..43bf8b2 100644
--- a/core/maven-plugin/pom.xml
+++ b/core/maven-plugin/pom.xml
@@ -296,4 +296,49 @@
 
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
diff --git a/core/mavendeps/intellij/pom.xml b/core/mavendeps/intellij/pom.xml
index 49a55c3..e37cc5e 100644
--- a/core/mavendeps/intellij/pom.xml
+++ b/core/mavendeps/intellij/pom.xml
@@ -37,5 +37,45 @@
     <description>
         Deprecated - profile moved to isis-mavendeps-webapp
     </description>
-    
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>bom</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
diff --git a/core/mavendeps/testing/pom.xml b/core/mavendeps/testing/pom.xml
index 670ed17..7108dba 100644
--- a/core/mavendeps/testing/pom.xml
+++ b/core/mavendeps/testing/pom.xml
@@ -85,6 +85,47 @@
 
             </dependencies>
         </profile>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>bom</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <parent>resolve</parent>
+                                        <profile>resolve</profile>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
-    
+
 </project>
diff --git a/core/mavendeps/webapp/pom.xml b/core/mavendeps/webapp/pom.xml
index a9f0341..715e52b 100644
--- a/core/mavendeps/webapp/pom.xml
+++ b/core/mavendeps/webapp/pom.xml
@@ -99,6 +99,47 @@
                 </dependency>
             </dependencies>
         </profile>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>bom</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <parent>resolve</parent>
+                                        <profile>resolve</profile>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
-    
+
 </project>
diff --git a/core/metamodel/pom.xml b/core/metamodel/pom.xml
index 35bc1ca..66557ad 100644
--- a/core/metamodel/pom.xml
+++ b/core/metamodel/pom.xml
@@ -123,4 +123,50 @@
         </dependency>
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/pom.xml b/core/pom.xml
index 5b1e55e..3e934fa 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -1138,36 +1138,6 @@ ${license.additional-notes}
                     <skip>false</skip>
                 </configuration>
             </plugin>
-
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>flatten-maven-plugin</artifactId>
-                <version>1.0.0</version>
-                <configuration>
-                    <updatePomFile>true</updatePomFile>
-                    <pomElements>
-                        <dependencyManagement>resolve</dependencyManagement>
-                        <dependencies>resolve</dependencies>
-                    </pomElements>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>flatten</id>
-                        <phase>process-resources</phase>
-                        <goals>
-                            <goal>flatten</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>flatten.clean</id>
-                        <phase>clean</phase>
-                        <goals>
-                            <goal>clean</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
         </plugins>
     </build>
 
@@ -2380,6 +2350,46 @@ ${license.additional-notes}
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>bom</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <parent>resolve</parent>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
     <modules>
diff --git a/core/runtime/pom.xml b/core/runtime/pom.xml
index 178c739..0bfb4c5 100644
--- a/core/runtime/pom.xml
+++ b/core/runtime/pom.xml
@@ -187,6 +187,48 @@
                 </dependency>
             </dependencies>
         </profile>
-
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
+
 </project>
diff --git a/core/schema/pom.xml b/core/schema/pom.xml
index bb3baa4..d79220d 100644
--- a/core/schema/pom.xml
+++ b/core/schema/pom.xml
@@ -129,6 +129,49 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
+
 </project>
diff --git a/core/security-shiro/pom.xml b/core/security-shiro/pom.xml
index 9d228e7..b7e301f 100644
--- a/core/security-shiro/pom.xml
+++ b/core/security-shiro/pom.xml
@@ -114,4 +114,50 @@
         </dependency>
 
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
diff --git a/core/security/pom.xml b/core/security/pom.xml
index 6bf4155..0ce8138 100644
--- a/core/security/pom.xml
+++ b/core/security/pom.xml
@@ -46,4 +46,51 @@
             <scope>test</scope>
         </dependency>    
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/specsupport/pom.xml b/core/specsupport/pom.xml
index 1bf20da..8316735 100644
--- a/core/specsupport/pom.xml
+++ b/core/specsupport/pom.xml
@@ -61,4 +61,49 @@
 
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
diff --git a/core/unittestsupport/pom.xml b/core/unittestsupport/pom.xml
index 06b3a3f..0ba97f1 100644
--- a/core/unittestsupport/pom.xml
+++ b/core/unittestsupport/pom.xml
@@ -95,4 +95,50 @@
 
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/viewer-restfulobjects-applib/pom.xml b/core/viewer-restfulobjects-applib/pom.xml
index 6c0910b..212f825 100644
--- a/core/viewer-restfulobjects-applib/pom.xml
+++ b/core/viewer-restfulobjects-applib/pom.xml
@@ -114,4 +114,49 @@
         </repository>
     </repositories>
 
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
diff --git a/core/viewer-restfulobjects-rendering/pom.xml b/core/viewer-restfulobjects-rendering/pom.xml
index 3550092..3bd77db 100644
--- a/core/viewer-restfulobjects-rendering/pom.xml
+++ b/core/viewer-restfulobjects-rendering/pom.xml
@@ -67,4 +67,51 @@
         </dependency>
 
 	</dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/viewer-restfulobjects-server/pom.xml b/core/viewer-restfulobjects-server/pom.xml
index 39820cd..c4ed12d 100644
--- a/core/viewer-restfulobjects-server/pom.xml
+++ b/core/viewer-restfulobjects-server/pom.xml
@@ -73,4 +73,51 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/viewer-wicket-applib/pom.xml b/core/viewer-wicket-applib/pom.xml
index 9733614..03cc160 100644
--- a/core/viewer-wicket-applib/pom.xml
+++ b/core/viewer-wicket-applib/pom.xml
@@ -84,4 +84,51 @@
         </dependency>
 
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/viewer-wicket-impl/pom.xml b/core/viewer-wicket-impl/pom.xml
index bd754fa..10f7289 100644
--- a/core/viewer-wicket-impl/pom.xml
+++ b/core/viewer-wicket-impl/pom.xml
@@ -101,4 +101,51 @@
         </dependency>
 
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/viewer-wicket-model/pom.xml b/core/viewer-wicket-model/pom.xml
index eaa291c..a9b0700 100644
--- a/core/viewer-wicket-model/pom.xml
+++ b/core/viewer-wicket-model/pom.xml
@@ -68,4 +68,51 @@
         </dependency>
 
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/viewer-wicket-ui/pom.xml b/core/viewer-wicket-ui/pom.xml
index bc4d0fd..8953733 100644
--- a/core/viewer-wicket-ui/pom.xml
+++ b/core/viewer-wicket-ui/pom.xml
@@ -156,4 +156,51 @@
         </dependency>
 
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/webserver/pom.xml b/core/webserver/pom.xml
index d81a7c2..94069b9 100644
--- a/core/webserver/pom.xml
+++ b/core/webserver/pom.xml
@@ -55,4 +55,50 @@
         </dependency>
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>
diff --git a/core/wrapper/pom.xml b/core/wrapper/pom.xml
index c9a18c7..420920c 100644
--- a/core/wrapper/pom.xml
+++ b/core/wrapper/pom.xml
@@ -71,4 +71,51 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>flatten</id>
+            <activation>
+                <property>
+                    <name>revision</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                        <version>1.0.0</version>
+                        <executions>
+                            <execution>
+                                <id>flatten</id>
+                                <phase>process-resources</phase>
+                                <goals>
+                                    <goal>flatten</goal>
+                                </goals>
+                                <configuration>
+                                    <flattenMode>defaults</flattenMode>
+                                    <updatePomFile>true</updatePomFile>
+                                    <pomElements>
+                                        <name>resolve</name>
+                                        <description>resolve</description>
+                                        <dependencies>resolve</dependencies>
+                                    </pomElements>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>flatten.clean</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+
 </project>


[isis] 05/06: ISIS-1965: reworks the flatten maven plugin

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 36e738fbc12f4ffd9ffc4adabf745344dce0f204
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Sep 1 00:33:37 2018 +0100

    ISIS-1965: reworks the flatten maven plugin
---
 .gitlab-ci.yml | 58 +++++++++++++++++++++++-----------------------------------
 1 file changed, 23 insertions(+), 35 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 50607a9..63d0fac 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -44,40 +44,28 @@ build-package-push:
           -Dnexus-deploy.repositoryUrl=$NEXUS_REPO_URL \
           $CORE_ADDITIONAL_OPTS
     - cd ..
+    - cd example/application/$APP_NAME
+    - >
+      mvn --batch-mode \
+          install \
+          -Drevision=$REVISION \
+          -Disis.version=$REVISION \
+          $CORE_ADDITIONAL_OPTS \
+          -Dmavenmixin-docker \
+          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME
+    - >
+      mvn -s .m2/settings.xml \
+          --batch-mode \
+          docker:push@push-image-tagged \
+          -pl webapp \
+          -Drevision=$REVISION \
+          -Disis.version=$REVISION \
+          -DskipTests \
+          -Dskip.isis-swagger \
+          -Dmavenmixin-docker \
+          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME \
+          -Ddocker-plugin.serverId=docker-registry \
+          -Ddocker.registryUrl=$DOCKER_REGISTRY_URL
+    - cd ../../..
 
-#
-# remainder commented out for now, see: https://gitlab.com/gitlab-org/gitlab-runner/issues/3552
-#
-# it's possible that the mvn command to build the Docker image is failing ... it seems to get stuck.
-# maybe the background stuff is deadlocking?
-# then, the CI job for reporting the failure/uploading artifacts then hangs.
-# if that's correct, then commenting this out is a problem because we're masking an error on our side.
-#
-# on the other hand, I can't reproduce this issue locally.
-#
 
-#    - cd example/application/$APP_NAME
-#    - >
-#      mvn --batch-mode \
-#          install \
-#          -Drevision=$REVISION \
-#          -Disis.version=$REVISION \
-#          $CORE_ADDITIONAL_OPTS \
-#          -Dmavenmixin-docker \
-#          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME
-#    - >
-#      mvn -s .m2/settings.xml \
-#          --batch-mode \
-#          docker:push@push-image-tagged \
-#          -pl webapp \
-#          -Drevision=$REVISION \
-#          -Disis.version=$REVISION \
-#          -DskipTests \
-#          -Dskip.isis-swagger \
-#          -Dmavenmixin-docker \
-#          -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME \
-#          -Ddocker-plugin.serverId=docker-registry \
-#          -Ddocker.registryUrl=$DOCKER_REGISTRY_URL
-#    - cd ../../..
-#
-#


[isis] 03/06: ISIS-1974: adds logging and larger queue for ThreadPoolSupport

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 188ae3262354207f3db0672cfe8d366145103e57
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Aug 30 00:19:11 2018 +0200

    ISIS-1974: adds logging and larger queue for ThreadPoolSupport
    
    also removes the no-op RejectedExecutionHandler which might have resulted in hanging for larger apps
---
 .../metamodel/specloader/SpecificationLoader.java  |  5 ++
 .../core/runtime/threadpool/ThreadPoolSupport.java | 65 ++++++++++++++++------
 .../system/session/IsisSessionFactoryBuilder.java  | 38 +++++++++++++
 .../wicket/viewer/IsisWicketApplication.java       | 28 +++-------
 .../src/main/webapp/WEB-INF/logging.properties     | 13 ++++-
 .../src/main/webapp/WEB-INF/logging.properties     | 13 ++++-
 6 files changed, 120 insertions(+), 42 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
index 81f39e8..9589f9f 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
@@ -204,6 +204,11 @@ public class SpecificationLoader implements ApplicationScopedComponent {
                     introspectIfRequired(specification);
                     return null;
                 }
+                public String toString() {
+                    return String.format(
+                            "introspectIfRequired(\"%s\")",
+                            specification.getFullIdentifier());
+                }
             };
             callables.add(callable);
         }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java
index c131f18..6c74b1f 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java
@@ -26,11 +26,13 @@ import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.RejectedExecutionHandler;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
+import com.google.common.base.Function;
+import com.google.common.collect.FluentIterable;
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 
 import org.slf4j.Logger;
@@ -40,38 +42,32 @@ public final class ThreadPoolSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(ThreadPoolSupport.class);
 
-    public static ThreadGroup group;
+    private final static int KEEP_ALIVE_TIME_SECS = 5;
+    private final static int QUEUE_CAPACITY = 5000;
 
-    public static ThreadPoolExecutor executor   ;
+    private static final ThreadGroup group;
+    private static final BlockingQueue<Runnable> workQueue;
+    private static final ThreadPoolExecutor executor   ;
 
     static {
         group = new ThreadGroup(ThreadPoolSupport.class.getName());
+        workQueue = new LinkedBlockingQueue<>(QUEUE_CAPACITY);
 
         final int corePoolSize = Runtime.getRuntime().availableProcessors();
         final int maximumPoolSize = Runtime.getRuntime().availableProcessors();
-        final int keepAliveTimeSecs = 5;
-
-        final int queueCapacity = 200;
-        final BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<>(queueCapacity);
 
         executor = new ThreadPoolExecutor(
                 corePoolSize,
                 maximumPoolSize,
-                keepAliveTimeSecs, TimeUnit.SECONDS,
+                KEEP_ALIVE_TIME_SECS,
+                TimeUnit.SECONDS,
                 workQueue,
                 new ThreadFactory() {
                     @Override
                     public Thread newThread(final Runnable r) {
                         return new Thread(group, r);
                     }
-                }, new RejectedExecutionHandler() {
-            @Override
-            public void rejectedExecution(final Runnable r, final ThreadPoolExecutor executor) {
-                int i;
-                i=1;
-
-            }
-        });
+                });
     }
 
     public static List<Object> join(final List<Future<Object>> futures) {
@@ -95,7 +91,9 @@ public final class ThreadPoolSupport {
             return returnValues;
         } finally {
             final long t1 = System.currentTimeMillis();
-            LOG.info("join'ing {} tasks: waited {} milliseconds ", futures.size(), (t1-t0));
+            if(LOG.isInfoEnabled()) {
+                LOG.info("join'ing {} tasks: waited {} milliseconds ", futures.size(), (t1-t0));
+            }
         }
     }
 
@@ -133,8 +131,39 @@ public final class ThreadPoolSupport {
     }
 
     public static List<Future<Object>> invokeAll(final List<Callable<Object>> callables) {
+        final long queuedAt = System.currentTimeMillis();
         try {
-            return executor.invokeAll(callables);
+            ImmutableList<Callable<Object>> timedCallables =
+                    FluentIterable.from(callables).transform(
+                        new Function<Callable<Object>, Callable<Object>>() {
+                            @Override
+                            public Callable<Object> apply(final Callable<Object> callable) {
+                                return new Callable<Object>() {
+                                    @Override
+                                    public Object call() throws Exception {
+
+                                        final long startedAt = System.currentTimeMillis();
+                                        if(LOG.isDebugEnabled()) {
+                                            LOG.debug("START: workQueue.size: {}, waited for: {}ms, {}",
+                                                    workQueue.size(),
+                                                    startedAt - queuedAt,
+                                                    callable.toString());
+                                        }
+                                        try {
+                                            return callable.call();
+                                        } finally {
+                                            final long completedAt = System.currentTimeMillis();
+                                            if(LOG.isDebugEnabled()) {
+                                                LOG.debug("END: completed in: {}ms, {}",
+                                                        completedAt - startedAt,
+                                                        callable.toString());
+                                            }
+                                        }
+                                    }
+                                };
+                            }
+                        }).toList();
+            return executor.invokeAll(timedCallables);
         } catch (InterruptedException e) {
             throw new RuntimeException(e);
         }
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
index 9aa7097..2a00f07 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
@@ -55,6 +55,9 @@ import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory
 import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProvider;
 import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProviderDefault2;
 import org.apache.isis.core.runtime.threadpool.ThreadPoolSupport;
+import org.apache.isis.schema.utils.ChangesDtoUtils;
+import org.apache.isis.schema.utils.CommandDtoUtils;
+import org.apache.isis.schema.utils.InteractionDtoUtils;
 
 public class IsisSessionFactoryBuilder {
 
@@ -212,13 +215,48 @@ public class IsisSessionFactoryBuilder {
 
                             return null;
                         }
+                        public String toString() {
+                            return "SpecificationLoader#init()";
+                        }
+
                     },
                     new Callable<Object>() {
                         @Override public Object call() {
                             persistenceSessionFactory.init(configuration);
                             return null;
                         }
+                        public String toString() {
+                            return "persistenceSessionFactory#init(...)";
+                        }
+                    },
+                    new Callable<Object>() {
+                        @Override public Object call() throws Exception {
+                            ChangesDtoUtils.init();
+                            return null;
+                        }
+                        public String toString() {
+                            return "ChangesDtoUtils.init()";
+                        }
+                    },
+                    new Callable<Object>() {
+                        @Override public Object call() throws Exception {
+                            InteractionDtoUtils.init();
+                            return null;
+                        }
+                        public String toString() {
+                            return "InteractionDtoUtils.init()";
+                        }
+                    },
+                    new Callable<Object>() {
+                        @Override public Object call() throws Exception {
+                            CommandDtoUtils.init();
+                            return null;
+                        }
+                        public String toString() {
+                            return "CommandDtoUtils.init()";
+                        }
                     }
+
             );
 
             ThreadPoolSupport.joinGatherFailures(futures);
diff --git a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index d6e0874..3f47039 100644
--- a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -91,9 +91,6 @@ import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
 import org.apache.isis.core.runtime.threadpool.ThreadPoolSupport;
 import org.apache.isis.core.webapp.IsisWebAppBootstrapper;
 import org.apache.isis.core.webapp.WebAppConstants;
-import org.apache.isis.schema.utils.ChangesDtoUtils;
-import org.apache.isis.schema.utils.CommandDtoUtils;
-import org.apache.isis.schema.utils.InteractionDtoUtils;
 import org.apache.isis.viewer.wicket.model.isis.WicketViewerSettings;
 import org.apache.isis.viewer.wicket.model.isis.WicketViewerSettingsAccessor;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
@@ -448,6 +445,9 @@ public class IsisWicketApplication
                         configureWebJars();
                         return null;
                     }
+                    public String toString() {
+                        return "configureWebJars()";
+                    }
                 },
                 new Callable<Object>() {
                     @Override
@@ -455,6 +455,9 @@ public class IsisWicketApplication
                         configureWicketBootstrap();
                         return null;
                     }
+                    public String toString() {
+                        return "configureWicketBootstrap()";
+                    }
                 },
                 new Callable<Object>() {
                     @Override
@@ -462,23 +465,8 @@ public class IsisWicketApplication
                         configureWicketSelect2();
                         return null;
                     }
-                },
-                new Callable<Object>() {
-                    @Override public Object call() throws Exception {
-                        ChangesDtoUtils.init();
-                        return null;
-                    }
-                },
-                new Callable<Object>() {
-                    @Override public Object call() throws Exception {
-                        InteractionDtoUtils.init();
-                        return null;
-                    }
-                },
-                new Callable<Object>() {
-                    @Override public Object call() throws Exception {
-                        CommandDtoUtils.init();
-                        return null;
+                    public String toString() {
+                        return "configureWicketSelect2()";
                     }
                 }
         );
diff --git a/example/application/helloworld/src/main/webapp/WEB-INF/logging.properties b/example/application/helloworld/src/main/webapp/WEB-INF/logging.properties
index ded0152..573a664 100644
--- a/example/application/helloworld/src/main/webapp/WEB-INF/logging.properties
+++ b/example/application/helloworld/src/main/webapp/WEB-INF/logging.properties
@@ -103,6 +103,17 @@ log4j.logger.org.apache.isis.applib.services.audit.AuditerServiceLogging=DEBUG,A
 log4j.additivity.org.apache.isis.applib.services.audit.AuditerServiceLogging=false
 
 
+# threadpool
+log4j.appender.ThreadPoolSupport=org.apache.log4j.FileAppender
+log4j.appender.ThreadPoolSupport.File=./logs/ThreadPoolSupport.log
+log4j.appender.ThreadPoolSupport.Append=false
+log4j.appender.ThreadPoolSupport.layout=org.apache.log4j.PatternLayout
+log4j.appender.ThreadPoolSupport.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
+
+log4j.logger.org.apache.isis.core.runtime.threadpool.ThreadPoolSupport=DEBUG,ThreadPoolSupport
+log4j.additivity.org.apache.isis.core.runtime.threadpool.ThreadPoolSupport=false
+
+
 
 
 ! turn on the internal log4j debugging flag so we can see what it is doing
@@ -215,8 +226,6 @@ log4j.additivity.org.apache.isis.core.commons.config.IsisConfigurationDefault=fa
 log4j.logger.org.apache.isis.core.runtime.installers.InstallerLookupDefault=WARN,Console
 log4j.additivity.org.apache.isis.core.runtime.installers.InstallerLookupDefault=false
 
-log4j.logger.org.apache.isis.core.runtime.threadpool.ThreadPoolSupport=INFO,Console
-log4j.additivity.org.apache.isis.core.runtime.threadpool.ThreadPoolSupport=false
 
 
 
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/logging.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/logging.properties
index ded0152..573a664 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/logging.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/logging.properties
@@ -103,6 +103,17 @@ log4j.logger.org.apache.isis.applib.services.audit.AuditerServiceLogging=DEBUG,A
 log4j.additivity.org.apache.isis.applib.services.audit.AuditerServiceLogging=false
 
 
+# threadpool
+log4j.appender.ThreadPoolSupport=org.apache.log4j.FileAppender
+log4j.appender.ThreadPoolSupport.File=./logs/ThreadPoolSupport.log
+log4j.appender.ThreadPoolSupport.Append=false
+log4j.appender.ThreadPoolSupport.layout=org.apache.log4j.PatternLayout
+log4j.appender.ThreadPoolSupport.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
+
+log4j.logger.org.apache.isis.core.runtime.threadpool.ThreadPoolSupport=DEBUG,ThreadPoolSupport
+log4j.additivity.org.apache.isis.core.runtime.threadpool.ThreadPoolSupport=false
+
+
 
 
 ! turn on the internal log4j debugging flag so we can see what it is doing
@@ -215,8 +226,6 @@ log4j.additivity.org.apache.isis.core.commons.config.IsisConfigurationDefault=fa
 log4j.logger.org.apache.isis.core.runtime.installers.InstallerLookupDefault=WARN,Console
 log4j.additivity.org.apache.isis.core.runtime.installers.InstallerLookupDefault=false
 
-log4j.logger.org.apache.isis.core.runtime.threadpool.ThreadPoolSupport=INFO,Console
-log4j.additivity.org.apache.isis.core.runtime.threadpool.ThreadPoolSupport=false
 
 
 


[isis] 01/06: ISIS-1974: introspects in parallel

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit b3eb20c97ab14bf8951018149b7cc71ba0533c73
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Aug 26 23:31:04 2018 +0100

    ISIS-1974: introspects in parallel
---
 .../metamodel/specloader/SpecificationLoader.java  | 83 +++++++++++++++++++---
 .../specimpl/dflt/ObjectSpecificationDefault.java  |  1 -
 .../core/runtime/threadpool/ThreadPoolSupport.java | 47 ++++++++++--
 .../dflt/ProgrammingModelForObjectSpecIdFacet.java | 45 ++++++++++++
 .../system/session/IsisSessionFactoryBuilder.java  |  3 +-
 5 files changed, 161 insertions(+), 18 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
index ca81150..81f39e8 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
@@ -20,7 +20,10 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Future;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Lists;
@@ -40,6 +43,7 @@ import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.lang.ClassUtil;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facets.FacetFactory;
+import org.apache.isis.core.metamodel.facets.MethodRemoverConstants;
 import org.apache.isis.core.metamodel.facets.object.autocomplete.AutoCompleteFacet;
 import org.apache.isis.core.metamodel.facets.object.objectspecid.ObjectSpecIdFacet;
 import org.apache.isis.core.metamodel.layoutmetadata.LayoutMetadataReader;
@@ -58,7 +62,9 @@ import org.apache.isis.core.metamodel.specloader.specimpl.dflt.ObjectSpecificati
 import org.apache.isis.core.metamodel.specloader.specimpl.standalonelist.ObjectSpecificationOnStandaloneList;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidator;
 import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
+import org.apache.isis.core.runtime.threadpool.ThreadPoolSupport;
 import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
+import org.apache.isis.progmodels.dflt.ProgrammingModelForObjectSpecIdFacet;
 
 /**
  * Builds the meta-model.
@@ -93,6 +99,8 @@ public class SpecificationLoader implements ApplicationScopedComponent {
     private final ProgrammingModel programmingModel;
     private final FacetProcessor facetProcessor;
 
+    FacetProcessor facetProcessorObjectSpecId;
+
     private final IsisConfiguration configuration;
     private final ServicesInjector servicesInjector;
 
@@ -101,6 +109,13 @@ public class SpecificationLoader implements ApplicationScopedComponent {
     private final List<LayoutMetadataReader> layoutMetadataReaders;
     private final PostProcessor postProcessor;
 
+    enum State {
+        NOT_INITIALIZED,
+        CACHING,
+        INTROSPECTING
+    }
+
+
     public SpecificationLoader(
             final IsisConfiguration configuration,
             final ProgrammingModel programmingModel,
@@ -118,6 +133,8 @@ public class SpecificationLoader implements ApplicationScopedComponent {
         this.postProcessor = new PostProcessor(programmingModel, servicesInjector);
 
         this.layoutMetadataReaders = layoutMetadataReaders;
+
+        this.state = State.NOT_INITIALIZED;
     }
 
     @Override
@@ -132,7 +149,7 @@ public class SpecificationLoader implements ApplicationScopedComponent {
 
     //region > init
 
-    private boolean initialized = false;
+    private State state;
 
     /**
      * Initializes and wires up, and primes the cache based on any service
@@ -152,34 +169,78 @@ public class SpecificationLoader implements ApplicationScopedComponent {
         }
 
         // initialize subcomponents
-        programmingModel.init();
+        this.programmingModel.init();
         facetProcessor.init();
+
+        ProgrammingModel programmingModelForObjectSpecId = new ProgrammingModelForObjectSpecIdFacet(configuration);
+        facetProcessorObjectSpecId = new FacetProcessor(programmingModelForObjectSpecId) {
+            @Override
+            public void injectDependenciesInto(final FacetFactory factory) {
+                // no-op... otherwise hit an exception in the other thread, but don't (yet) know why.
+            }
+        };
+        programmingModelForObjectSpecId.init();
+        facetProcessorObjectSpecId.init();
+
         postProcessor.init();
         metaModelValidator.init(this);
 
+
+        state = State.CACHING;
+
         loadSpecificationsForServices();
         loadSpecificationsForMixins();
         cacheBySpecId();
 
-        initialized = true;
+        state = State.INTROSPECTING;
+
+        final Collection<ObjectSpecification> objectSpecifications = allSpecifications();
+
+        final List<Callable<Object>> callables = Lists.newArrayList();
+        for (final ObjectSpecification specification : objectSpecifications) {
+            Callable<Object> callable = new Callable<Object>() {
+                @Override
+                public Object call() {
+                    introspectIfRequired(specification);
+                    return null;
+                }
+            };
+            callables.add(callable);
+        }
+        List<Future<Object>> futures = ThreadPoolSupport.invokeAll(callables);
+        ThreadPoolSupport.joinGatherFailures(futures);
+
     }
 
     private void loadSpecificationsForServices() {
-        for (final Class<?> serviceClass : allServiceClasses()) {
+        final Properties metadataProperties = new Properties();
+
+        List<Class<?>> classes = allServiceClasses();
+        for (final Class<?> serviceClass : classes) {
             final DomainService domainService = serviceClass.getAnnotation(DomainService.class);
             final NatureOfService nature = domainService != null ? domainService.nature() : NatureOfService.DOMAIN;
             // will 'markAsService'
-            internalLoadSpecification(serviceClass, nature);
+            ObjectSpecification objectSpecification = internalLoadSpecification(serviceClass, nature);
+
+            facetProcessorObjectSpecId.process(
+                    serviceClass, metadataProperties,
+                    MethodRemoverConstants.NULL, objectSpecification);
         }
     }
 
     private void loadSpecificationsForMixins() {
+        final Properties metadataProperties = new Properties();
+
         final Set<Class<?>> mixinTypes = AppManifest.Registry.instance().getMixinTypes();
         if(mixinTypes == null) {
             return;
         }
         for (final Class<?> mixinType : mixinTypes) {
-            internalLoadSpecification(mixinType);
+            ObjectSpecification objectSpecification = internalLoadSpecification(mixinType);
+            facetProcessorObjectSpecId.process(
+                    mixinType, metadataProperties,
+                    MethodRemoverConstants.NULL, objectSpecification);
+
         }
     }
 
@@ -196,10 +257,6 @@ public class SpecificationLoader implements ApplicationScopedComponent {
         cache.setCacheBySpecId(specById);
     }
 
-    @Programmatic
-    public boolean isInitialized() {
-        return initialized;
-    }
 
 
     //endregion
@@ -210,7 +267,7 @@ public class SpecificationLoader implements ApplicationScopedComponent {
     public void shutdown() {
         LOG.info("shutting down {}", this);
 
-        initialized = false;
+        state = State.NOT_INITIALIZED;
 
         cache.clear();
     }
@@ -437,6 +494,10 @@ public class SpecificationLoader implements ApplicationScopedComponent {
      */
     private ObjectSpecification introspectIfRequired(final ObjectSpecification spec) {
 
+        if(state != State.INTROSPECTING) {
+            return spec;
+        }
+
         final ObjectSpecificationAbstract specSpi = (ObjectSpecificationAbstract)spec;
         final ObjectSpecificationAbstract.IntrospectionState introspectionState = specSpi.getIntrospectionState();
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
index 65d2ff3..ca56568 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/dflt/ObjectSpecificationDefault.java
@@ -103,7 +103,6 @@ public class ObjectSpecificationDefault extends ObjectSpecificationAbstract impl
     }
 
 
-
     //endregion
 
     //region > introspectTypeHierarchyAndMembers
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java
index 09c9fe7..c131f18 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/runtime/threadpool/ThreadPoolSupport.java
@@ -26,6 +26,7 @@ import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.RejectedExecutionHandler;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -50,7 +51,7 @@ public final class ThreadPoolSupport {
         final int maximumPoolSize = Runtime.getRuntime().availableProcessors();
         final int keepAliveTimeSecs = 5;
 
-        final int queueCapacity = 25;
+        final int queueCapacity = 200;
         final BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<>(queueCapacity);
 
         executor = new ThreadPoolExecutor(
@@ -63,7 +64,14 @@ public final class ThreadPoolSupport {
                     public Thread newThread(final Runnable r) {
                         return new Thread(group, r);
                     }
-                });
+                }, new RejectedExecutionHandler() {
+            @Override
+            public void rejectedExecution(final Runnable r, final ThreadPoolExecutor executor) {
+                int i;
+                i=1;
+
+            }
+        });
     }
 
     public static List<Object> join(final List<Future<Object>> futures) {
@@ -75,7 +83,38 @@ public final class ThreadPoolSupport {
         try{
             final List<Object> returnValues = Lists.newArrayList();
             for (Future<Object> future : futures) {
-                returnValues.add(join(future));
+                Object result;
+                try {
+                    result = future.get();
+                } catch (InterruptedException | ExecutionException e) {
+                    // ignore
+                    result = null;
+                }
+                returnValues.add(result);
+            }
+            return returnValues;
+        } finally {
+            final long t1 = System.currentTimeMillis();
+            LOG.info("join'ing {} tasks: waited {} milliseconds ", futures.size(), (t1-t0));
+        }
+    }
+
+    public static List<Object> joinGatherFailures(final List<Future<Object>> futures) {
+        if (futures == null) {
+            return null;
+        }
+
+        final long t0 = System.currentTimeMillis();
+        try{
+            final List<Object> returnValues = Lists.newArrayList();
+            for (Future<Object> future : futures) {
+                final Object result;
+                try {
+                    result = future.get();
+                } catch (InterruptedException | ExecutionException e) {
+                    throw new RuntimeException(e);
+                }
+                returnValues.add(result);
             }
             return returnValues;
         } finally {
@@ -89,8 +128,8 @@ public final class ThreadPoolSupport {
             return future.get();
         } catch (InterruptedException | ExecutionException e) {
             // ignore
+            return null;
         }
-        return null;
     }
 
     public static List<Future<Object>> invokeAll(final List<Callable<Object>> callables) {
diff --git a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelForObjectSpecIdFacet.java b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelForObjectSpecIdFacet.java
new file mode 100644
index 0000000..61f08a1
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelForObjectSpecIdFacet.java
@@ -0,0 +1,45 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License. */
+
+package org.apache.isis.progmodels.dflt;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.facets.object.objectspecid.classname.ObjectSpecIdFacetDerivedFromClassNameFactory;
+import org.apache.isis.core.metamodel.progmodel.ObjectSpecificationPostProcessor;
+import org.apache.isis.core.metamodel.progmodel.ProgrammingModelAbstract;
+
+public final class ProgrammingModelForObjectSpecIdFacet extends ProgrammingModelAbstract {
+
+    public ProgrammingModelForObjectSpecIdFacet(final IsisConfiguration configuration) {
+        this(DeprecatedPolicy.parse(configuration));
+    }
+
+    public ProgrammingModelForObjectSpecIdFacet(final DeprecatedPolicy deprecatedPolicy) {
+        super(deprecatedPolicy);
+
+        addFactory(new ObjectSpecIdFacetDerivedFromClassNameFactory());
+    }
+
+    @Override
+    public List<ObjectSpecificationPostProcessor> getPostProcessors() {
+        return Collections.emptyList();
+    }
+
+}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
index 72d8ef2..9aa7097 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
@@ -221,8 +221,7 @@ public class IsisSessionFactoryBuilder {
                     }
             );
 
-            ThreadPoolSupport.join(futures);
-
+            ThreadPoolSupport.joinGatherFailures(futures);
 
             persistenceSessionFactory.catalogNamedQueries(specificationLoader);