How to build a jar even if the project has a compilation error?

1

I'm starting the process of automating the builds of our application, and in the project have some classes with compilation error.

Despite some compilation errors, the application is working fine. I will have to do a task force, to remove the compilation errors but the project is very large and I would like to do this only in the future.

At the moment I would like Maven to create the JAR even if there are compilation errors.

I made a change in my pom.xml so that the build does not crash, even if there are compilation errors:

...
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <failOnError>false</failOnError>
            </configuration>
        </plugin>
    </plugins>
</build>
...

However, when I run maven package an empty JAR is created, with no class. How to make maven create JAR with classes that could be compiled even though there are other classes with compilation errors?

    
asked by anonymous 07.07.2014 / 14:50

1 answer

2
___ erkimt ___ How to build a jar even if the project has a compilation error? ______ qstntxt ___

I'm starting the process of automating the builds of our application, and in the project have some classes with compilation error.

Despite some compilation errors, the application is working fine. I will have to do a task force, to remove the compilation errors but the project is very large and I would like to do this only in the future.

At the moment I would like Maven to create the JAR even if there are compilation errors.

I made a change in my compile so that the build does not crash, even if there are compilation errors:

%pre%

However, when I run compile an empty JAR is created, with no class. How to make maven create JAR with classes that could be compiled even though there are other classes with compilation errors?

    
______ ___ azszpr23699

I believe that this is not possible. The build will go through the phases of the Maven build cycle, and when you arrive at package % will just stop and ... as per% %code% standard runs before %code% % would not be possible for you to create this jar way.

As I understand it you have a huge application with compilation errors, but you still want to create a jar, because no compilation error parts are working.

I have worked once in a legacy project as well. What I did at the time, it was to create other sources directory. If you have the src / main / java, you can create a legacy-src and move the classes with error go. Hence in your IDE you include this directory in the build and will gradually packing, but the important thing is that what is in src / main / java is OK.

In this way Maven will do normal build, generate the jar etc. And the files in legacy-src will not be used.

Or if you still prefer (or if you need to versioning, etc.) you can create another project and go packing gradually classes as well.

    
___
07.07.2014 / 17:03
Error in mysql query in php ___ ___ erkimt Excel Do list and get values ______ qstntxt ___

I have a little doubt when making a file in Excel.

In my excel have a page (Sheet1) with several tables and figures. I wonder if it is possible I make a list in the "Sheet2" and choose an option it give me a value that is in the Table "Sheet1" to be able to make a calculation sheet in two.

Sheet 1:

%pre%

Sheet 2:

%pre%     
______ ___ azszpr25155

One suggestion would be to create a list of a function after VLOOKUP to seek the values of the other columns, eg:

Create a call sheet list that contains the data to be fetched, as the image below:

Createanotherworksheetnamedsearch,selecttherangeofcellswhereyouwanttocreatethelist,goonthe then allow select the list and < strong> source select the list cell range as below:

willbecreatedtolistthevaluesofthefirstcolumnoftheworksheetlist.

InthespreadsheetcellB1makeasearchfunctionVLOOKUP , to search the list the selected value and return the column with index 2:

%pre%

This function will search the spreadsheet list the selected value in cell A1 and return the column with index 2, that is selected will return 1 100, selected second return 200.

Repeat for cell C1 to return the column with index 3

%pre%

search Filmography

    
___