PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label ant. Show all posts
Showing posts with label ant. Show all posts

Sunday, October 9, 2022

[FIXED] How to build several projects with dependencies

 October 09, 2022     ant, continuous-integration, ivy     No comments   

Issue

I have workspace with n projects. I want to use ant to build all the projects with one command. The projects are depend on each other

For example project A depends on project B, so I want B to compile first When I compile project An I need to use B's project classpath. The dependencies between the projects are represented in a ivy.xml file

The main challenge is that I have my own repository where all those projects have artifacts, and using the example I just gave Project A compiles against the B project coming from my the repository and not Against the B project that just was compiled.

I use CI process and I don't want to publish any project to my repository before all of them compiled and the the the QA tests was passed

What is the best practice build several projects with dependencies using ant?


Solution

You can combine the ivy buildlist task with subant to build the sub-projects in the correct order, based on dependencies.

See the following answer for an example:

  • ivy simple shared repository

Using this approach it's possible to re-create how Maven works without switching build tools.



Answered By - Mark O'Connor
Answer Checked By - Katrina (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, September 27, 2022

[FIXED] How to setup Jenkins with JUnit

 September 27, 2022     ant, continuous-deployment, continuous-integration, jenkins, junit     No comments   

Issue

We have a JUnit test suite that we usually run from Eclipse. We have recently started a process of trying to get a better development environment. As part of this we have started building our project in Jenkins. We would also like it if it was possible to run theJUnit test suite during our build. To do this I think we need a way to execute the test suite from command line so that we can integrate them in Jenkins and parse their output.

How can we set up Jenkins to run our tests?


Solution

You could create a junit ant task during your build and let Jenkins run that task

Here are some lines we used on a project. Here launching a suite called AllNonGWTTestCaseTests

<target name="runTests" description="Run JUnit tests">
    <junit printsummary="yes" dir="test-classes" fork="true">
        <classpath>
            <pathelement location="inst-classes" />
        </classpath>
        <test name="xxx.AllNonGWTTestCaseTests" haltonfailure="no" outfile="result">
            <formatter type="xml" />
        </test>
    </junit>
</target>

Building this will create the file result.xml. That configures an ant task. Jenkins can launch this ant task. Take a look at your project configuration. Section Build > Ant task. Then in Post-build Actions just set the path to the xml file : result.xml

This should make Jenkins run the test suite as a post build action.



Answered By - Michael Laffargue
Answer Checked By - Marilyn (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Thursday, April 28, 2022

[FIXED] How do you get *ant* to not print out javac warnings?

 April 28, 2022     ant, javac, warnings     No comments   

Issue

I just want the errors, and nothing else, to be printed out for now. Thanks :)


Solution

Have you tried

<javac .... nowarn="on"> 

Note that this does not disable all kinds of warnings.



Answered By - Thilo
Answer Checked By - David Marino (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home
View mobile version

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing