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>
Related
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.
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>
We just started using Robot Framework using Eclipse and Maven. We want to run only certain test suites(test suites will have testcases).Is there any way to do that?
There are no pybot options to exclude suites, other than to not include them on the command line in the first place. That being said, you have a couple of options to accomplish the same thing.
The first option is to give all your tests tags, and then use the --exclude option to exclude tests with particular tags. For example, in my organization we use robot for both automated and manual tests. When we run in an unattended fashion we will exclude all of the test cases with the manual tag.
If that is impractical, your other option is to enumerate the suites that you do want to run. This is tedious, but is made easier if you use an argument file. For example, you can create a file with the following contents:
--suite fullsuite.subsuite1
--suite fullsuite.subsuite3
--suite fullsuite.subsuite4
If you save it to a file named "skip2.args" you can then reference this on the command line with the --argumentfile option. For example:
pybot --argumentfile skip2.args ./fullsuite
You can combine these two techniques. For example, to skip "subsuite2" and also skip all tests tagged as manual, you can simply add the --exclude option to the .args file:
--suite fullsuite.subsuite1
--suite fullsuite.subsuite3
--suite fullsuite.subsuite4
--exclude manual
For more information on command line options you can type pybot --help at the command line, or see the section All command line arguments in the robot framework user guide.
Here is how you can select which robot tests you want to execute, when using maven.
Maven's pom.xml file looks like this:
....
<properties>
<suite.test />
<include.tag />
<exclude1.tag></exclude1.tag>
<exclude2.tag></exclude2.tag>
<exclude3.tag > EXCLUDE </exclude3.tag>
....
</properties>
....
<build>
<plugins>
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<configuration>
<suites>
<suite>${suite.test}</suite>
</suites>
<includes>
<tag>${include.tag}</tag>
</includes>
<excludes>
<tag>${exclude1.tag}</tag>
<tag>${exclude2.tag}</tag>
<tag>${exclude3.tag}</tag>
</excludes>
.....
</configuration>
....
</plugin>
.....
</plugins>
.....
</build>
Without command line options, all tests suites are executed, except the ones tagged with EXCLUDE:
mvn robotframework:run
Command line options can be added to fine tune which testsuites are executed.
This command only executes the test suite named PerformanceSuite
mvn robotframework:run -Dsuite.test=PerformanceSuite
This command executes all test suites except the ones tagged with EXCLUDE (default behavior) and the ones tagged with "DEMO" or "SAMPLE"
mvn robotframework:run -Dexclude1.tag=DEMO -Dexclude2.tag=SAMPLE
This command runs only tests suites tagged with "SERVER" but excludes the ones taged with SAMPLE:
mvn robotframework:run -Dinclude.tag=SERVER -Dexclude1.tag=SAMPLE
Remember that tags are (recursively) inherited, in the current test-suite from the parent test suite.
When a jar is created using Maven. The META-INF directory in the jar contains sub-directory maven/group-id/artifact-id with pom.xml and pom.properties. How to do it with SBT?
Is there an option of a plugin that does that?
You can always publish 'maven style' with sbt - This will create the pom and pom.properties correctly.
To do this, you can use:
publishMavenStyle := true
And you will probably need to add the extra information required by the pom. To do this, set pomExtra:
pomExtra :=
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
For more information, see the docs: Publishing and the following describes in detail how to publish to a maven repo: Deploying to Sonatype.
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.