How to exclude extra jar files from shar-amp.amp - alfresco

In Alfresco sdk 2.1 I have obeserved during build it is packaging many jar files within Share AMP file. I want to get rid of all those files and keep it light weight.Is there any way to do it apart from manually removing those jars files from AMP? I was also wondering weather it will break something in some scenerios because till now I did not come across any such scenerios.

If the resulting AMPs contains too many JARs please make sure that you
Do a mvn clean install when building your artifacts for deployment
Inspect the dependencies in pom.xml and make sure to set <scope>provided</scope> for the ones you don't need
Which JARs end up in the AMP? Any dependencies you specified yourself or?

Thanks Ole for your response.
I was able to get rid of those jars by adding <scope>provided</scope> in following dependency config in pom.xml of share
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0-alfresco</version>
<scope>test</scope>
</dependency>

Related

JAWR generator using less to css not finding jawr_generator.css

I'm trying to get JAWR working with the generator configuration to convert less into CSS post compile but I keep getting errors when I try where it's trying to go to a jawr_generator.css file as this is supported (if I'm reading the documentation correctly) in newer versions but I'm getting a 404 doesn't exist.
I'm using maven, spring, and JAWR (project requirement, yes I know grunt and other things can do what we're doing but I need it using these technologies). I'm not wanting to do this at compile time with the Pom files either because we want hot swapping without using the less plugin for intelliJ.
From what I'm reading all you have to do is have JAWR set up, include the less4j in your maven config along with JAWR (JAWR is already functioning from a compile time configuration) and change the resource to .less at the directory you're pointing to, does anyone have any idea what I'm missing?
applicable parts of pom (version of JAWR is 1.7.0.1.1 if I'm not mistaken, it's just not defined in this POM explicitly):
...
<dependency>
<groupId>com.github.sommeri</groupId>
<artifactId>less4j</artifactId>
<version>1.17.2</version>
</dependency>
...
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<configuration>
<sourceDirectory>ourSourceDirectoryPath</sourceDirectory>
<outputDirectory>targetPath/ourDirectory
</outputDirectory>
<includes>
<include>otherFileCompiledAtCompile.less</include>
</includes>
</configuration>
</plugin>
jawr.properties:
# fileName (note I've ripped out this from our actual names to make this generic)
jawr.js.bundle.bundleName.id=/bundles/fileName.js
jawr.js.bundle.bundleName.mappings=/path/js/fileName.js,/path/otherFileName.js
jawr.css.bundle.bundleName.id=/bundles/fileName.css
jawr.css.bundle.bundleName.mappings=/path/css/lib/fileName.less
Anyone have any ideas as to what I'm missing here? I've changed all the files and paths somewhat just for sanitization of data, it works fine when I put it in the pom. However if I try and get the resources to dynamically compile less to css at runtime it's saying this in the web browser developer tools debugger console and not showing the css file as being loaded:
Failed to http://ourUrl.com/path/jawr_generator.css?generationConfigParam=%2fpath%2fcss%2flib%2ffileName.less
load resource: the server responded with a status of 404 (Not Found)
The jawr_generator.css isn't a file we use, it seems to be a part of JAWR itself and doesn't get compiled/exist. I'm assuming I'm missing a configuration or a property somewhere to enable this, anyone have any ideas? Thanks in advance for any help.
We've resolved this, there was an issue with one of the paths where it was placing the file in a different directory than it was in the original file structure. Fixing this resolved the issue. The anltr conflict was a red herring. Closing as resolved.

Unable to get the required gwtopenlayers jars

How can I get the jars for org.gwtopenmaps.demo.openlayers.client.basic and org.gwtopenmaps.demo.openlayers.client.components.store packages.I want to import AbstractExample and ShowcaseExampleStore classes into my java file.
You won't find any jars for that, as the showcase is only available as a war.
Just download the GWT-OpenLayers sourcecode at github extract what you want.

Missing test helper classes (e.g. RunAsFullyAuthenticatedRule) in mvn build

I've been attempting to follow along with this blog post to create a test in the maven build - http://blogs.aca-it.be/blogs/-/blogs/alfresco-summit-part-5-%E2%80%93-developing-json-rest-services-with-webscripts - they use RunAsFullyAuthenticatedRule and ApplicationContextInit in their tests but in the standard maven build these do not resolve. Do I have to add something to the pom.xml in order to use these classes?
I got the answer from the author of the blog.
" Those classes used to be packaged with the alfresco-repository dependency before 4.1.4. Add this dependency:"
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-repository</artifactId>
<version>${alfresco.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>

How to find from where sbt is picking repositories file information

I am having issues to make sbt to pick dependencies.
I want to know from where sbt is reading the repositories information. Means which file it is reading.
Can we get the file name and location.
I tried to see project/repositories
and .sbt/repositores
they are not having content which sbt is showing
Thanks
show resolvers and show externalResolvers will show all of the Maven and/or Ivy repositories that your dependencies can be pulled from.
show fullClasspath will show the full pathnames of all of the JARs on your classpath.

Config Intellj to support modules with Flex Mojos

I have a large app which compiles fine with maven. However it's structure is very complicated and the source for each maven module (almost all maven modules in this app are FlexMojo ones), does not live under each pom.
So the source directory in each pom is
<build>
<sourceDirectory>../../src/flex</sourceDirectory>
....
</build>
While this works fine with Maven, when I import the project as a maven project in intellj, Intellij is unable to resolve any Flex stuff. I'm worried it's because it cannot find the source under each each folder module.
Can this be changed somewhere in intellij?
I'm not sure about Flex, but in Intellij's module settings you can define source directories as you please.

Resources