How to calculate minimum set of jars required to compile Play application? - ant

Our release engineering is dictating that we cannot use SBT. We have to use ANT.
We need a proper list of jars that are required to compile a PlayFramework application. We are using Play 2.3.4 and (i think!) Scala 2.10 --- this was what got downloaded from activator-1.2.3.
Any thoughts on how to figure out minimum essential set of jars?
Right now, there is an issue with Controller class and iteratees... (i imagine these are in some scala jars)
Questions:
what do the jar numbering scheme on jars in user's ivy cache have two sets of numbers - for eg, play-java-2.3.4-2.10. Does this mean it's Play framework rev 2.3.4 compiled with scala 2.10 ?
is there a minimum list?

tl;dr activator stage and then grab the jars from target/universal/stage/lib.
Play Framework offers stage task that can prepare your application to be run in place:
This cleans and compiles your application, retrieves the required
dependencies and copies them to the target/universal/stage directory.
It also creates a bin/<start> script where <start> is the project’s
name. The script runs the Play server on Unix style systems and there
is also a corresponding bat file for Windows.
After you've executed the stage task, you grab the jars from target/universal/stage and you should be fine to go offline or...cough, cough...ant.
[jars-needed-play] $ stage
[info] Packaging /Users/jacek/sandbox/jars-needed-play/target/scala-2.11/jars-needed-play_2.11-1.0-SNAPSHOT-sources.jar ...
[info] Done packaging.
[info] Updating {file:/Users/jacek/sandbox/jars-needed-play/}root...
[info] Wrote /Users/jacek/sandbox/jars-needed-play/target/scala-2.11/jars-needed-play_2.11-1.0-SNAPSHOT.pom
[info] Resolving jline#jline;2.11 ...
[info] Done updating.
[info] Main Scala API documentation to /Users/jacek/sandbox/jars-needed-play/target/scala-2.11/api...
[info] Compiling 5 Scala sources and 1 Java source to /Users/jacek/sandbox/jars-needed-play/target/scala-2.11/classes...
[info] Packaging /Users/jacek/sandbox/jars-needed-play/target/jars-needed-play-1.0-SNAPSHOT-assets.jar ...
[info] Done packaging.
model contains 17 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /Users/jacek/sandbox/jars-needed-play/target/scala-2.11/jars-needed-play_2.11-1.0-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] Packaging /Users/jacek/sandbox/jars-needed-play/target/scala-2.11/jars-needed-play_2.11-1.0-SNAPSHOT.jar ...
[info] Done packaging.
[success] Total time: 4 s, completed Oct 1, 2014 9:09:29 AM
[jars-needed-play] $ eval "ls target/universal/stage/lib" !
ch.qos.logback.logback-classic-1.1.1.jar
ch.qos.logback.logback-core-1.1.1.jar
...
xerces.xercesImpl-2.11.0.jar
xml-apis.xml-apis-1.4.01.jar
[info] ans: Int = 0

Related

How to skip the scan for test files on few modules in a multi module project while using Sonarqube

I'm setting this property <sonar.tests>src/test/java</sonar.tests>
in the root pom file, the project consist of 7 modules, 5 modules have test cases in the mentioned location, while the other do not have tests, so the sonar scans and fails as shown :
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40.072 s
[INFO] Finished at: 2020-01-13T01:38:06-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project sch: The directory '/var/lib/jenkins/workspace/sonar-sch/anonymization/src/test/java' does not exist for Maven module com.interset:anonymization:jar:6.0.0-SNAPSHOT. Please check the property sonar.tests -> [Help 1]
How can i skip the scan for tests on the 2 modules or any other workaround would help too, as ill need that property for the code coverage, Thanks.
As already mentioned in the comments: Specify <sonar.tests></sonar.tests> in the modules without a test folder to remove the test folder property.

How do I install the Neo4j-spatial plugin?

Vanilla neo4j 2.2.0 install on a Ubuntu 14.04 system via their repository.
The instructions given on the neo4j-spatial website don't work. Does anyone have something that works no-questions-asked?
Is there some binary repository I can just apt-get install neo4j-spatial and not deal with this mess?
Thanks!
$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Neo4j - Spatial Components
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.neo4j:neo4j-cypher-compiler-2.2
Reason: Error getting POM for 'org.neo4j:neo4j-cypher-compiler-2.2' from the repository: Unable to read local copy of metadata: Cannot read metadata from '/home/ubuntu/.m2/repository/org/neo4j/neo4j-cypher-compiler-2.2/2.2-SNAPSHOT/maven-metadata-oss.sonatype.org.xml': end tag name </body> must match start tag name <hr> from line 5 (position: TEXT seen ...</center>\r\n</body>... #6:8)
org.neo4j:neo4j-cypher-compiler-2.2:pom:2.2-SNAPSHOT
for project org.neo4j:neo4j-cypher-compiler-2.2
The Neo4j-Spatial Project was updated and released for Neo4j 2.2
The readme was also updated with the new binary download links.

Stop Grails compilation from showing dots

Is there a configuration option, command line parameter, or a property that would stop Grails compilation from being cute and showing the growing trail of dots for operations that take time? It does so by sending "\r" to console and printing the previous line with another dot appended. It looks ok but still a little flashy when the compilation runs in console but it looks ugly in automated builds (see below). I wonder if there is a way to tell it not to print the progress indication. Thank you!
[exec] [INFO] | Resolving plugin JAR dependencies
[exec] [INFO] | Resolving plugin JAR dependencies.
[exec] [INFO] | Resolving plugin JAR dependencies..
[exec] [INFO] | Resolving plugin JAR dependencies...
[exec] [INFO] | Resolving plugin JAR dependencies....
Grails does offer a switch on the console/command line to remove the dots from the output (and a few other fancy things). It's called --plain-output and it can be used as such:
grails prod war --plain-output

Vaadin Maven Plugin tries to compile subversion directory as a theme

I have an example project created using -
mvn archetype:generate -DarchetypeGroupId=com.vaadin \
-DarchetypeArtifactId=vaadin-archetype-application \
-DarchetypeVersion=7.2.5 -Dpackaging=war \
-DgroupId=com.Example -DartifactId=ProjectA
During the maven compilation, the compile-theme goal tries to compile the subversion directory.
[INFO] --- vaadin-maven-plugin:7.2.5:compile-theme (default) # UIEngine ---
[INFO] Updating theme VAADIN/themes/bootstrap
[INFO] Theme "VAADIN/themes/bootstrap" compiled
[INFO] Updating theme VAADIN/themes/.svn
[ERROR] /home/gpn/workspace/ProjectA/src/main/webapp/VAADIN/themes/.svn/styles.scss could not be read!
[INFO] Theme "VAADIN/themes/.svn" compiled
Is there any method to tell maven to ignore .svn directory or to compile only certain themes?
Thanks and Best Regards,
GPN
Add <theme>bootstrap</theme> to the configuration of the vaadin-maven-plugin in your pom.xml. After that the plugin will only compile the given theme.
If you can use a newer version of SVN (1.7 or later) to checkout your source then there will no longer be any .svn directories in the working copy.

Not created by default settings.xml in $/user/.m2/repository path using Maven

I tried below command its work properly
C:\Documents and Settings\users>mvn -v
Apache Maven 3.0 (r1004208; 2010-10-04 17:20:56+0530)
Java version: 1.6.0_21
Java home: C:\Program Files\Java\jdk1.6.0_21\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
and once I tried to compile simple HelloWorld.java program. Its give me below error...
C:\my-app>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Quick Start Archetype 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-resour
ces-plugin/2.4.3/maven-resources-plugin-2.4.3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.454s
[INFO] Finished at: Thu Nov 18 13:08:50 IST 2010
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of i
ts dependencies could not be resolved: Could not transfer artifact org.apache.ma
ven.plugins:maven-resources-plugin:jar:2.4.3 from central (http://repo1.maven.or
g/maven2): Error transferring file: Connection refused: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
onException
Please any one update me with proper solutions.
First, you really should format your questions better. Just cutting and pasting without any regard what it would look like when submitted doesn't help you in getting a quick and concise answer.
Second, what exactly is your question? You subject says one thing, but your text says another.
Now I'll take a stab at both your subject and your text.
As far as the subject is concerned, the settings.xml file is not automatically created by Maven. You have to create this and configure it the way you want. See this website for more info about the settings.xml.
As far as the text is concerned, looks like you do not have access to the Maven repo. This can because by a number things. The most obvious ones are:
The repository is not specified in the project's pom.xml file as described here.
The server you are running this on does not have access to http://repo1.maven.org/maven2/ due to firewall or internet connectivity reasons.
Double check that:
this was not an intermittent problem
you didn't get bad metadata (and clean up the entire ~/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/)

Resources